Skip to content

Commit

Permalink
fix missing CSV header
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Oct 2, 2024
1 parent f1ea478 commit 208d3e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions piccolo_admin/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ async def download_movies(

output_file = io.StringIO(None)

csv.DictWriter(
writer = csv.DictWriter(
f=output_file,
fieldnames=["name", "release_date"],
).writerows(movies)
)
writer.writeheader()
writer.writerows(movies)

return FileResponse(
contents=output_file,
Expand Down

0 comments on commit 208d3e2

Please sign in to comment.