mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Prepend slug to exported filenames (#719)
This commit is contained in:
committed by
Raphael Michel
parent
8543cb7ece
commit
f81a7a397a
@@ -26,7 +26,7 @@ class InvoiceExporter(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 'invoices.zip', 'application/zip', zipf.read()
|
return '{}_invoices.zip'.format(self.event.slug), 'application/zip', zipf.read()
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_data_exporters, dispatch_uid="exporter_invoices")
|
@receiver(register_data_exporters, dispatch_uid="exporter_invoices")
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class JSONExporter(BaseExporter):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'pretixdata.json', 'application/json', json.dumps(jo, cls=DjangoJSONEncoder)
|
return '{}_pretixdata.json'.format(self.event.slug), 'application/json', json.dumps(jo, cls=DjangoJSONEncoder)
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_data_exporters, dispatch_uid="exporter_json")
|
@receiver(register_data_exporters, dispatch_uid="exporter_json")
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class MailExporter(BaseExporter):
|
|||||||
).values('attendee_email')
|
).values('attendee_email')
|
||||||
data = "\r\n".join(set(a['email'] for a in addrs)
|
data = "\r\n".join(set(a['email'] for a in addrs)
|
||||||
| set(a['attendee_email'] for a in pos if a['attendee_email']))
|
| set(a['attendee_email'] for a in pos if a['attendee_email']))
|
||||||
return 'pretixemails.txt', 'text/plain', data.encode("utf-8")
|
return '{}_pretixemails.txt'.format(self.event.slug), 'text/plain', data.encode("utf-8")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def export_form_fields(self):
|
def export_form_fields(self):
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class QuotaListExporter(BaseExporter):
|
|||||||
]
|
]
|
||||||
writer.writerow(row)
|
writer.writerow(row)
|
||||||
|
|
||||||
return 'quotas.csv', 'text/csv', output.getvalue().encode("utf-8")
|
return '{}_quotas.csv'.format(self.event.slug), 'text/csv', output.getvalue().encode("utf-8")
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_data_exporters, dispatch_uid="exporter_orderlist")
|
@receiver(register_data_exporters, dispatch_uid="exporter_orderlist")
|
||||||
|
|||||||
Reference in New Issue
Block a user