From 68b39af3e40cd206978c9012f4042aadd9556797 Mon Sep 17 00:00:00 2001 From: Francesco Filicetti Date: Thu, 28 Mar 2024 19:24:57 +0100 Subject: [PATCH] fix: csv export --- uniticket/uni_ticket/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uniticket/uni_ticket/utils.py b/uniticket/uni_ticket/utils.py index 8e882358..85380b57 100644 --- a/uniticket/uni_ticket/utils.py +++ b/uniticket/uni_ticket/utils.py @@ -526,11 +526,11 @@ def disabled_expired_items(items): def export_input_module_csv( module, - delimiter="$", - quotechar='"', - dialect="excel", ticket_codes_list=[], file_name="export.csv", + delimiter =',', + quotechar ='"', + quoting=csv.QUOTE_ALL ): module.ticket_category @@ -566,7 +566,10 @@ def export_input_module_csv( csv_file["Content-Disposition"] = 'attachment; filename="{}"'.format( file_name) writer = csv.writer( - csv_file, dialect=dialect, delimiter=delimiter, quotechar=quotechar + csv_file, + delimiter=delimiter, + quotechar=quotechar, + quoting=quoting ) writer.writerow(head)