Commit 4969c84a authored by MOREAU Ulysse's avatar MOREAU Ulysse
Browse files

Merge branch 'add-mail-in-boutique-csv' into 'master'

Add email in product csv export

See merge request !53
parents 5e8a79e3 69cd04a5
......@@ -176,9 +176,10 @@ class CsvExportView(PermissionRequiredMixin, SingleObjectMixin, View):
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = f'attachment; filename="{self.object.name}.csv"'
writer = csv.writer(response)
writer.writerow(['Username', 'Quantity', 'Paid', 'Customization', 'Option', 'Second Option', 'Quantity delivered'])
writer.writerow(['Username', 'Email', 'Quantity', 'Paid', 'Customization', 'Option', 'Second Option', 'Quantity delivered'])
for oi in item.order_items.all():
writer.writerow([str(oi.order.user.profile),
oi.order.user.email,
oi.quantity,
oi.order.paid,
oi.customization,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment