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

@@ -686,6 +686,15 @@ class Order(LockModel, LoggedModel):
}
)
@property
def positions_with_tickets(self):
for op in self.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
yield op
def answerfile_name(instance, filename: str) -> str:
secret = get_random_string(length=32, allowed_chars=string.ascii_letters + string.digits)