mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Put event slugs in export filenames (#768)
This commit is contained in:
committed by
Raphael Michel
parent
ded539ce7a
commit
741d0bc686
@@ -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")
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user