fix: Poprawka składni SQLAlchemy dla ARRAY contains
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0db3cbc754
commit
624941114a
4
app.py
4
app.py
@ -14060,7 +14060,7 @@ def admin_announcements():
|
||||
if status_filter != 'all':
|
||||
query = query.filter(Announcement.status == status_filter)
|
||||
if category_filter != 'all':
|
||||
query = query.filter(Announcement.categories.any(category_filter))
|
||||
query = query.filter(Announcement.categories.contains([category_filter]))
|
||||
|
||||
# Sort: pinned first, then by created_at desc
|
||||
query = query.order_by(
|
||||
@ -14385,7 +14385,7 @@ def announcements_list():
|
||||
|
||||
# Filter by category (supports both single category and categories array)
|
||||
if category and category in Announcement.CATEGORIES:
|
||||
query = query.filter(Announcement.categories.any(category))
|
||||
query = query.filter(Announcement.categories.contains([category]))
|
||||
|
||||
# Sort: pinned first, then by published_at desc
|
||||
query = query.order_by(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user