Properly indent handling for non-addons

This commit is contained in:
Martin Gross
2019-09-23 11:12:50 +02:00
parent 7f8d290ae1
commit f296f262e6

View File

@@ -276,13 +276,13 @@ def variables_from_questions(sender, *args, **kwargs):
else:
a = op.addon_to.answers.filter(question_id=question_id).first()
if 'answers' in getattr(op, '_prefetched_objects_cache', {}):
try:
a = [a for a in op.answers.all() if a.question_id == question_id][0]
except IndexError:
pass
else:
a = op.answers.filter(question_id=question_id).first()
if 'answers' in getattr(op, '_prefetched_objects_cache', {}):
try:
a = [a for a in op.answers.all() if a.question_id == question_id][0]
except IndexError:
pass
else:
a = op.answers.filter(question_id=question_id).first()
if not a:
return ""