diff --git a/app.py b/app.py index 1aace7c..406eac3 100644 --- a/app.py +++ b/app.py @@ -2856,6 +2856,11 @@ def admin_receipts(list_id=None): page, per_page = get_page_args(default_per_page=24, max_per_page=200) if list_id is not None: + target_list = db.session.get(ShoppingList, list_id) + if not target_list: + flash("Lista nie istnieje.", "danger") + return redirect(url_for("admin_lists_access")) + all_receipts = ( Receipt.query.options(joinedload(Receipt.uploaded_by_user)) .filter_by(list_id=list_id)