fix: ensure count is never null in GET /refractor/cards (#183)

Guards against Peewee 3.17.9 returning None from .count() on a
complex multi-join query when 0 rows match the filter set.

Closes #183

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-06 01:34:04 -05:00
parent cc65dc5395
commit 4e7418707f

View File

@ -211,7 +211,7 @@ async def list_card_states(
if evaluated_only:
query = query.where(RefractorCardState.last_evaluated_at.is_null(False))
total = query.count()
total = query.count() or 0
items = []
for state in query.offset(offset).limit(limit):
player_name = None