PDF: Fix inheritance of answers to add-on products

This commit is contained in:
Raphael Michel
2021-08-23 18:42:21 +02:00
parent 276add9163
commit ec5a670ea6

View File

@@ -434,7 +434,7 @@ def images_from_questions(sender, *args, **kwargs):
except IndexError:
pass
else:
a = op.answers.filter(question_id=question_id).first()
a = op.answers.filter(question_id=question_id).first() or a
if not a or not a.file or not any(a.file.name.lower().endswith(e) for e in (".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif", ".tiff")):
return None
@@ -474,7 +474,7 @@ def variables_from_questions(sender, *args, **kwargs):
except IndexError:
pass
else:
a = op.answers.filter(question_id=question_id).first()
a = op.answers.filter(question_id=question_id).first() or a
if not a:
return ""