fix: remove dead roster fields from CSV in v1_cards_get_one (#25)

Card model has no roster1/2/3 fields. Accessing them would raise
AttributeError at runtime. Removed the non-existent columns from
the CSV header and data row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-03 12:06:21 -06:00 committed by cal
parent d031553e03
commit 6a2e8a2d2a

View File

@ -141,9 +141,8 @@ async def v1_cards_get_one(card_id, csv: Optional[bool] = False):
if csv:
data_list = [
['id', 'player', 'team', 'pack', 'value', 'roster1', 'roster2', 'roster3'],
[this_card.id, this_card.player, this_card.team.abbrev, this_card.pack, this_card.value,
this_card.roster1.name, this_card.roster2.name, this_card.roster3.name]
['id', 'player', 'team', 'pack', 'value'],
[this_card.id, this_card.player, this_card.team.abbrev, this_card.pack, this_card.value]
]
return_val = DataFrame(data_list).to_csv(header=False, index=False)