From a1b4538954a28b8a120c89b48c60c86b10e1d2df Mon Sep 17 00:00:00 2001 From: type-two Date: Mon, 22 Jun 2026 20:58:50 +1000 Subject: [PATCH] =?UTF-8?q?fix(collections):=20is=5Factive=20is=20int=20no?= =?UTF-8?q?t=20bool=20=E2=80=94=20cast=20in=20queries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- app/collections_routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/collections_routes.py b/app/collections_routes.py index 81c96f9..2cf1ada 100644 --- a/app/collections_routes.py +++ b/app/collections_routes.py @@ -44,7 +44,7 @@ class CollectionIn(BaseModel): @router.get("/collections") async def list_collections(ident=Depends(require_token), db=Depends(get_db)): rows = (await db.execute(text(""" - SELECT id, name, color, priority, (is_active = 1 OR is_active = true) AS is_active, + SELECT id, name, color, priority, (is_active::int <> 0) AS is_active, crate_ids, style_ids, genre_ids, price_min::float, price_max::float, year_min, year_max FROM virtual_collection ORDER BY priority DESC, name """))).mappings() @@ -157,7 +157,7 @@ async def locate(release_id: int | None = Query(None), sku: str | None = Query(N cols = (await db.execute(text(""" SELECT id, name, color, crate_ids, genre_ids, style_ids, price_min::float AS pmin, price_max::float AS pmax, year_min, year_max - FROM virtual_collection WHERE is_active = 1 OR is_active = true ORDER BY priority DESC, name + FROM virtual_collection WHERE is_active::int <> 0 ORDER BY priority DESC, name """))).mappings() for c in cols: gmin, gmax = c["pmin"], c["pmax"]