Fix issue in OrderListExporter when mixing subevents with non-subevents

This commit is contained in:
Raphael Michel
2020-07-24 09:34:54 +02:00
parent 99b42d201e
commit 41127ce978

View File

@@ -430,12 +430,17 @@ class OrderListExporter(MultiSheetListExporter):
order.datetime.astimezone(tz).strftime('%Y-%m-%d'),
]
if has_subevents:
row.append(op.subevent.name)
row.append(op.subevent.date_from.astimezone(self.event_object_cache[order.event_id].timezone).strftime('%Y-%m-%d %H:%M:%S'))
if op.subevent.date_to:
row.append(op.subevent.date_to.astimezone(self.event_object_cache[order.event_id].timezone).strftime('%Y-%m-%d %H:%M:%S'))
if op.subevent:
row.append(op.subevent.name)
row.append(op.subevent.date_from.astimezone(self.event_object_cache[order.event_id].timezone).strftime('%Y-%m-%d %H:%M:%S'))
if op.subevent.date_to:
row.append(op.subevent.date_to.astimezone(self.event_object_cache[order.event_id].timezone).strftime('%Y-%m-%d %H:%M:%S'))
else:
row.append('')
else:
row.append('')
row.append('')
row.append('')
row += [
str(op.item),
str(op.variation) if op.variation else '',