mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-01 19:32:26 +02:00
black formatting
This commit is contained in:
parent
6b8eecdb6e
commit
d726284e00
2 changed files with 4 additions and 9 deletions
|
@ -1396,10 +1396,7 @@ class TestExportGroupedOrderEmailAddressesToCSVView:
|
||||||
)
|
)
|
||||||
response = client_log.get(email_list_view_url)
|
response = client_log.get(email_list_view_url)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert (
|
assert response.content.decode() == ""
|
||||||
response.content.decode()
|
|
||||||
== ''
|
|
||||||
)
|
|
||||||
|
|
||||||
email = order_items_in_grouped_order(grouped_order).author.email
|
email = order_items_in_grouped_order(grouped_order).author.email
|
||||||
response = client_log.get(email_list_view_url)
|
response = client_log.get(email_list_view_url)
|
||||||
|
|
|
@ -343,17 +343,15 @@ class ExportGroupOrderEmailAdressesToDownloadView(UserPassesTestMixin, generic.V
|
||||||
if format == "csv":
|
if format == "csv":
|
||||||
response = http.HttpResponse(content_type="text/csv")
|
response = http.HttpResponse(content_type="text/csv")
|
||||||
filename = f"commande _{grouped_order.name.replace(' ', '_')}"
|
filename = f"commande _{grouped_order.name.replace(' ', '_')}"
|
||||||
response['Content-Disposition'] = f'attachment; filename="{filename}.csv"'
|
response["Content-Disposition"] = f'attachment; filename="{filename}.csv"'
|
||||||
writer = csv.writer(response)
|
writer = csv.writer(response)
|
||||||
writer.writerow(['order_name', 'email'])
|
writer.writerow(["order_name", "email"])
|
||||||
for email in email_list:
|
for email in email_list:
|
||||||
writer.writerow([grouped_order.name, email])
|
writer.writerow([grouped_order.name, email])
|
||||||
return response
|
return response
|
||||||
else:
|
else:
|
||||||
email_list = ";\n".join(email_list)
|
email_list = ";\n".join(email_list)
|
||||||
return http.HttpResponse(
|
return http.HttpResponse(f"{email_list}")
|
||||||
f"{email_list}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ExportGroupedOrderToCSVView(GroupedOrderExportView):
|
class ExportGroupedOrderToCSVView(GroupedOrderExportView):
|
||||||
|
|
Loading…
Reference in a new issue