zabezpieczenie przed otwarciem paragonow z niestniejacej listy w panelu admina
This commit is contained in:
5
app.py
5
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)
|
||||
|
Reference in New Issue
Block a user