usuniecie zbednego kodu i poprawki

This commit is contained in:
Mateusz Gruszczyński
2025-08-15 15:50:49 +02:00
parent 40381774b4
commit 4602fb7749
2 changed files with 13 additions and 1 deletions

12
app.py
View File

@@ -2882,6 +2882,15 @@ def list_products():
if name not in used_suggestion_names
]
usage_counts = dict(
db.session.query(
func.lower(Item.name),
func.coalesce(func.sum(Item.quantity), 0)
)
.group_by(func.lower(Item.name))
.all()
)
query_string = urlencode({k: v for k, v in request.args.items() if k != "page"})
return render_template(
@@ -2894,7 +2903,8 @@ def list_products():
per_page=per_page,
total_pages=total_pages,
query_string=query_string,
total_items=total_items
total_items=total_items,
usage_counts=usage_counts
)