upgrade to new pretix, remove download, add page links
This commit is contained in:
@@ -1,18 +1,36 @@
|
||||
from pretix.base.ticketoutput import BaseTicketOutput
|
||||
|
||||
|
||||
class TextTicketOutput(BaseTicketOutput):
|
||||
identifier = 'tokens'
|
||||
verbose_name = 'Download token as in simple textfile'
|
||||
download_button_text = 'Download Token'
|
||||
identifier = "tokens"
|
||||
verbose_name = "Download token as in simple textfile"
|
||||
download_button_text = "Download Token"
|
||||
|
||||
def generate(self, position):
|
||||
token_export_format = "{name}: {secret}"
|
||||
if position.event.settings.digitalitems_token_export_format:
|
||||
token_export_format = position.event.settings.digitalitems_token_export_format
|
||||
return 'token.txt', 'text/plain', token_export_format.format(secret = position.secret, name = str(position.item.name))
|
||||
def generate(self, position):
|
||||
token_export_format = "{name}: {secret}"
|
||||
if position.event.settings.digitalitems_token_export_format:
|
||||
token_export_format = (
|
||||
position.event.settings.digitalitems_token_export_format
|
||||
)
|
||||
return (
|
||||
"token.txt",
|
||||
"text/plain",
|
||||
token_export_format.format(
|
||||
secret=position.secret, name=str(position.item.name)
|
||||
),
|
||||
)
|
||||
|
||||
def generate_order(self, order):
|
||||
token_export_format = "{name}: {secret}"
|
||||
if order.event.settings.digitalitems_token_export_format:
|
||||
token_export_format = order.event.settings.digitalitems_token_export_format
|
||||
return 'tokens.txt', 'text/plain', '\n'.join(token_export_format.format(secret = position.secret, name = str(position.item.name)) for position in order.positions.all())
|
||||
def generate_order(self, order):
|
||||
token_export_format = "{name}: {secret}"
|
||||
if order.event.settings.digitalitems_token_export_format:
|
||||
token_export_format = order.event.settings.digitalitems_token_export_format
|
||||
return (
|
||||
"tokens.txt",
|
||||
"text/plain",
|
||||
"\n".join(
|
||||
token_export_format.format(
|
||||
secret=position.secret, name=str(position.item.name)
|
||||
)
|
||||
for position in order.positions.all()
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user