2.2 KiB
2.2 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 573491c4-cced-4400-8029-84d6298df631 | fix | Fix: Remove dead roster fields from CSV in paper-dynasty-database v1_cards_get_one |
|
0.5 | 0.8 | 2026-03-03T20:36:36.060493+00:00 | 2026-03-04T02:32:18.715278+00:00 |
|
Problem
v1_cards_get_one in app/routers_v2/cards.py included roster1, roster2, roster3 in the CSV output. Accessing this_card.roster1.name etc. raises AttributeError at runtime because the Card model has no roster fields.
Root Cause
Dead code referencing non-existent model fields. The Card model only has player, team, pack, value fields.
Fix
Removed the three roster columns from both the CSV header list and the data row.
Before:
data_list = [
['id', 'player', 'team', 'pack', 'value', 'roster1', 'roster2', 'roster3'],
[..., this_card.roster1.name, this_card.roster2.name, this_card.roster3.name]
]
After:
data_list = [
['id', 'player', 'team', 'pack', 'value'],
[this_card.id, this_card.player, this_card.team.abbrev, this_card.pack, this_card.value]
]
Files Changed
app/routers_v2/cards.py
Notes
- Ruff linter hook auto-reformats the entire file on save (single → double quotes, line wrapping) — large diff but small functional change.
v1_cards_patchstill acceptsroster1_id/roster2_id/roster3_idparams that are silently ignored — dead API surface for a separate cleanup.