2.1 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 61b618e7-6c6a-46be-9dec-b31b57cb19fe | fix | Fix: dead roster CSV fields in paper-dynasty-database cards endpoint |
|
0.55 | 0.8 | 2026-03-03T18:07:05.018372+00:00 | 2026-03-03T19:33:19.971077+00:00 |
|
Problem
app/routers_v2/cards.py — v1_cards_get_one endpoint's CSV branch accessed this_card.roster1.name, this_card.roster2.name, this_card.roster3.name. The Card model has no such fields, so any GET /api/v2/cards/{id}?csv=true request would raise AttributeError at runtime.
Root Cause
The CSV code was written against an older schema that had roster foreign keys on Card. Those fields were removed from the model but the CSV export code was never updated.
Solution
Removed the three dead columns from the CSV header row and data row. The output now reflects only fields that exist on Card: id, player, team, pack, value.
Files Changed
app/routers_v2/cards.pylines 144–146
Note
The v1_cards_patch endpoint also accepts roster1_id, roster2_id, roster3_id params that are silently ignored (no assignment in handler body) — dead API surface but not a runtime error.