diff --git a/back/add_poems_and_filters.py b/back/add_poems_and_filters.py index 69daafb..6098811 100644 --- a/back/add_poems_and_filters.py +++ b/back/add_poems_and_filters.py @@ -52,6 +52,8 @@ async def filter_ann(schema: pydantic_schemas.SortAnnouncements, db: AsyncSessio # res = await db.execute(statement) # если фильтр задан if filt_val is not None: + if name == "obsolete": + filt_val = bool(filt_val) filter_query = await db.execute(select(orm_models.Announcement).where(literal_column(f"announcements.{name}") == filt_val)) filtered = set(filter_query.scalars().all()) res = res.intersection(filtered)