update tokens only for admission tickets

This commit is contained in:
_Bastler 2021-08-31 20:12:10 +02:00
parent 173dfe9582
commit f106e3ce4f

View File

@ -12,7 +12,7 @@ def register_mail_secrets(sender, **kwargs):
token_mail_format = "{name}: {secret}"
if sender.settings.digitalitems_token_mail_format:
token_mail_format = sender.settings.digitalitems_token_mail_format
return SimpleFunctionalMailTextPlaceholder('secrets', ['order'], lambda order: '\n' + '\n\n'.join(token_mail_format.format(secret = position.secret, name = str(position.item.name)) for position in order.positions.all()), '\nej7f73xs8vfmwvkk2p73yeve4fueq849\n\np8yct9752a897rpsmqzf7beby34a2w25\n\nwwqxtw6guy5s8c5tdarfhyez2ft2juap')
return SimpleFunctionalMailTextPlaceholder('secrets', ['order'], lambda order: '\n' + '\n\n'.join(token_mail_format.format(secret = position.secret, name = str(position.item.name)) for position in order.positions.all() if position.item.admission), '\nej7f73xs8vfmwvkk2p73yeve4fueq849\n\np8yct9752a897rpsmqzf7beby34a2w25\n\nwwqxtw6guy5s8c5tdarfhyez2ft2juap')
@receiver(register_ticket_outputs, dispatch_uid="pretix_digital_items_ticket_output")
def register_ticket_outputs(sender, **kwargs):