Do not attach empty files for orders without tickets

This commit is contained in:
Raphael Michel
2019-01-29 17:12:38 +01:00
parent 0285cd12f7
commit f35c2544b6
5 changed files with 17 additions and 17 deletions

View File

@@ -73,12 +73,7 @@ class PdfTicketOutput(BaseTicketOutput):
def generate_order(self, order: Order):
merger = PdfFileMerger()
with language(order.locale):
for op in order.positions.all():
if op.addon_to_id and not self.event.settings.ticket_download_addons:
continue
if not op.item.admission and not self.event.settings.ticket_download_nonadm:
continue
for op in order.positions_with_tickets:
layout = self.layout_map.get(
(op.item_id, order.sales_channel),
self.layout_map.get(