From ea46dd43e1ebee42d80daed74e197392282e2c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Fri, 15 Aug 2025 23:03:26 +0200 Subject: [PATCH] fix w sugestiach --- app.py | 4 +++- templates/admin/list_products.html | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index fbdada0..6f28d09 100644 --- a/app.py +++ b/app.py @@ -2900,6 +2900,7 @@ def list_products(): query_string = urlencode({k: v for k, v in request.args.items() if k != "page"}) + synced_names = set(suggestions_dict.keys()) return render_template( "admin/list_products.html", @@ -2912,7 +2913,8 @@ def list_products(): total_pages=total_pages, query_string=query_string, total_items=total_items, - usage_counts=usage_counts + usage_counts=usage_counts, + synced_names=synced_names ) diff --git a/templates/admin/list_products.html b/templates/admin/list_products.html index 54597da..50f16f0 100644 --- a/templates/admin/list_products.html +++ b/templates/admin/list_products.html @@ -38,13 +38,14 @@ {{ usage_counts.get(item.name.lower(), 0) }} - {% set suggestion = suggestions_dict.get(item.name.lower()) %} + {% set clean_name = item.name | replace('\xa0', ' ') | trim | lower %} + {% set suggestion = suggestions_dict.get(clean_name) %} {% if suggestion %} ✅ Istnieje (ID: {{ suggestion.id }}) - {% else %} - {% endif %} @@ -84,7 +85,7 @@ {{ suggestion.id }} {{ suggestion.name }} -