zmiana month na m i poprawka w kolorach paginaci

This commit is contained in:
Mateusz Gruszczyński
2025-08-13 14:49:33 +02:00
parent 01fa938a27
commit 4dfd1fa45f

15
app.py
View File

@@ -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