mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Fix: converting old to new question placeholders in ticketlayouts
This commit is contained in:
committed by
GitHub
parent
ff5c649cfc
commit
9f515a4b4e
@@ -102,9 +102,15 @@ def pdf_event_copy_data_receiver(sender, other, item_map, question_map, **kwargs
|
|||||||
for o in layout:
|
for o in layout:
|
||||||
if o['type'] == 'textarea':
|
if o['type'] == 'textarea':
|
||||||
if o['content'].startswith('question_'):
|
if o['content'].startswith('question_'):
|
||||||
newq = question_map.get(int(o['content'][9:]))
|
try:
|
||||||
if newq:
|
newq = question_map.get(int(o['content'][9:]))
|
||||||
o['content'] = 'question_{}'.format(newq.pk)
|
except ValueError:
|
||||||
|
# int cannot convert new placeholders question_{identifier}
|
||||||
|
# can be safely ignored as only old format questions_{pk} should be converted
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if newq:
|
||||||
|
o['content'] = 'question_{}'.format(newq.pk)
|
||||||
bl.layout = json.dumps(layout)
|
bl.layout = json.dumps(layout)
|
||||||
|
|
||||||
bl.save()
|
bl.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user