mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Properly indent handling for non-addons
This commit is contained in:
@@ -276,13 +276,13 @@ def variables_from_questions(sender, *args, **kwargs):
|
|||||||
else:
|
else:
|
||||||
a = op.addon_to.answers.filter(question_id=question_id).first()
|
a = op.addon_to.answers.filter(question_id=question_id).first()
|
||||||
|
|
||||||
if 'answers' in getattr(op, '_prefetched_objects_cache', {}):
|
if 'answers' in getattr(op, '_prefetched_objects_cache', {}):
|
||||||
try:
|
try:
|
||||||
a = [a for a in op.answers.all() if a.question_id == question_id][0]
|
a = [a for a in op.answers.all() if a.question_id == question_id][0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
a = op.answers.filter(question_id=question_id).first()
|
a = op.answers.filter(question_id=question_id).first()
|
||||||
|
|
||||||
if not a:
|
if not a:
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user