Peewee's .count() on a complex multi-join query can return None when the result wrapper yields an empty cursor for a 0-row result set. Guard with `or 0` so the response contract (count is always an integer) is upheld. Note: tier values outside 0–4 already return 422 via FastAPI's ge/le constraints on the tier parameter, so the reproduced scenario (tier=99 → count: null) is also covered by validation. Closes #182 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| models | ||
| routers_v2 | ||
| seed | ||
| services | ||
| __init__.py | ||
| card_creation.py | ||
| db_engine.py | ||
| db_helpers.py | ||
| dependencies.py | ||
| main.py | ||
| player_scouting.py | ||