fix: compute CSV after appending data row in get_one_player (#12)

return_val was assigned from DataFrame(data_list).to_csv() before the
player data row was appended to data_list, so the CSV response contained
only the header row. Moved the to_csv() call to after the append.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-03 20:31:40 -06:00
parent 761c0a6dab
commit 7a7935394c

View File

@ -622,7 +622,6 @@ async def get_one_player(player_id, csv: Optional[bool] = False):
"description",
]
]
return_val = DataFrame(data_list).to_csv(header=False, index=False)
data_list.append(
[
this_player.id,
@ -649,6 +648,7 @@ async def get_one_player(player_id, csv: Optional[bool] = False):
this_player.description,
]
)
return_val = DataFrame(data_list).to_csv(header=False, index=False)
return Response(content=return_val, media_type="text/csv")
else: