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 committed by cal
parent d1728a804f
commit 0166c7dda4

View File

@ -617,7 +617,6 @@ async def get_one_player(player_id: int, csv: Optional[bool] = False):
"description",
]
]
return_val = DataFrame(data_list).to_csv(header=False, index=False)
data_list.append(
[
this_player.id,
@ -644,6 +643,7 @@ async def get_one_player(player_id: int, 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: