From 208d3e27285621b1578dd68191be805311645d9a Mon Sep 17 00:00:00 2001 From: Daniel Townsend Date: Wed, 2 Oct 2024 10:09:20 +0100 Subject: [PATCH] fix missing CSV header --- piccolo_admin/example.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piccolo_admin/example.py b/piccolo_admin/example.py index 5794ed26..a4022f6d 100644 --- a/piccolo_admin/example.py +++ b/piccolo_admin/example.py @@ -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,