From 4dfd1fa45f4fc84fac2aa6688da43439d8d62332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Wed, 13 Aug 2025 14:49:33 +0200 Subject: [PATCH] zmiana month na m i poprawka w kolorach paginaci --- app.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app.py b/app.py index 6b463d2..7b023bd 100644 --- a/app.py +++ b/app.py @@ -1336,6 +1336,21 @@ def main_page(): .order_by(ShoppingList.created_at.desc()) .all() ) + + # Definiujemy widoczny zakres list dla tego użytkownika + if current_user.is_authenticated: + visible_lists_query = ShoppingList.query.filter( + or_( + ShoppingList.owner_id == current_user.id, + ShoppingList.is_public == True + ) + ) + else: + visible_lists_query = ShoppingList.query.filter( + ShoppingList.is_public == True + ) + + # Teraz możemy bezpiecznie pobrać miesiące month_options = get_active_months_query(visible_lists_query) all_lists = user_lists + public_lists + archived_lists