diff --git a/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-475fcd.md b/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-475fcd.md new file mode 100644 index 00000000000..58d20b9304d --- /dev/null +++ b/graph/fixes/fix-remove-dead-roster-fields-from-csv-in-paper-dynasty-data-475fcd.md @@ -0,0 +1,32 @@ +--- +id: 475fcd0d-8d29-471b-a6e3-f3face5320c9 +type: fix +title: "Fix: Remove dead roster fields from CSV in paper-dynasty-database v1_cards_get_one" +tags: [paper-dynasty, paper-dynasty-database, python, fastapi, fix, csv, dead-code] +importance: 0.5 +confidence: 0.8 +created: "2026-03-03T19:37:39.735071+00:00" +updated: "2026-03-03T19:37:39.735071+00:00" +--- + +## Problem + +`GET /api/v2/cards/{card_id}?csv=true` raised `AttributeError` at runtime because `v1_cards_get_one` referenced `this_card.roster1.name`, `this_card.roster2.name`, `this_card.roster3.name` — fields that do not exist on the `Card` model. + +## Root Cause + +Dead code referencing removed/never-implemented roster relationship fields on the `Card` ORM model. The `Card` model only has `player`, `team`, `pack`, `value`. + +## Solution + +Removed `roster1`, `roster2`, `roster3` from both the CSV header row and data row in `v1_cards_get_one` (`app/routers_v2/cards.py`). + +## Files Changed + +- `app/routers_v2/cards.py` — removed roster columns from CSV output + +## Notes + +- ruff linter hook reformats entire file on save (single→double quotes, line wrapping) — cosmetic noise in the diff +- `v1_cards_patch` still accepts `roster1_id`, `roster2_id`, `roster3_id` query params that are silently ignored — tracked as separate cleanup +- PR: https://git.manticorum.com/cal/paper-dynasty-database/pulls/37