When no position filters are applied, `final_players` is a lazy Peewee queryset with `ORDER BY RANDOM() LIMIT n`. Iterating it twice (once to build player_ids, once for the response loop) executes two separate DB queries with different random seeds, causing dex_by_player to be built for a different player set than returned, silently producing empty paperdex for all players. Add `final_players = list(final_players)` before building player_ids to ensure both iterations operate on the same materialized result. Also fix pre-existing syntax error in import statement and minor ruff lint issues in the same file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| routers_v2 | ||
| __init__.py | ||
| card_creation.py | ||
| db_engine.py | ||
| db_helpers.py | ||
| dependencies.py | ||
| main.py | ||
| player_scouting.py | ||