Put event slugs in export filenames (#768)

This commit is contained in:
Tobias Kunze
2018-02-12 12:30:13 +01:00
committed by Raphael Michel
parent ded539ce7a
commit 741d0bc686
4 changed files with 4 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ class AnswerFilesExporter(BaseExporter):
i.file.close() i.file.close()
with open(os.path.join(d, 'tmp.zip'), 'rb') as zipf: with open(os.path.join(d, 'tmp.zip'), 'rb') as zipf:
return 'answers.zip', 'application/zip', zipf.read() return '{}_answers.zip'.format(self.event.slug), 'application/zip', zipf.read()
@receiver(register_data_exporters, dispatch_uid="exporter_answers") @receiver(register_data_exporters, dispatch_uid="exporter_answers")

View File

@@ -140,7 +140,7 @@ class OrderListExporter(BaseExporter):
row.append(', '.join([i.number for i in order.invoices.all()])) row.append(', '.join([i.number for i in order.invoices.all()]))
writer.writerow(row) writer.writerow(row)
return 'orders.csv', 'text/csv', output.getvalue().encode("utf-8") return '{}_orders.csv'.format(self.event.slug), 'text/csv', output.getvalue().encode("utf-8")
class QuotaListExporter(BaseExporter): class QuotaListExporter(BaseExporter):

View File

@@ -319,4 +319,4 @@ class CSVCheckinList(BaseCheckinList):
writer.writerow(row) writer.writerow(row)
return 'checkin.csv', 'text/csv', output.getvalue().encode("utf-8") return '{}_checkin.csv'.format(self.event.slug), 'text/csv', output.getvalue().encode("utf-8")

View File

@@ -29,4 +29,4 @@ class AllTicketsPDF(BaseExporter):
p.save() p.save()
outbuffer = o._render_with_background(buffer) outbuffer = o._render_with_background(buffer)
return 'tickets.pdf', 'application/pdf', outbuffer.read() return '{}_tickets.pdf'.format(self.event.slug), 'application/pdf', outbuffer.read()