mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Allow empty plugin responses (#1056)
While plugin developers are supposed to return an empty dictionary, it's conceivable that they might just put in a `return` if their field is not needed, and pretix being generous about this would be cool.
This commit is contained in:
committed by
Raphael Michel
parent
9647cc6cf2
commit
3bf3ff1ee2
@@ -173,11 +173,12 @@ class OrderDetail(OrderView):
|
||||
p.additional_fields = []
|
||||
data = p.meta_info_data
|
||||
for r, response in sorted(responses, key=lambda r: str(r[0])):
|
||||
for key, value in response.items():
|
||||
p.additional_fields.append({
|
||||
'answer': data.get('question_form_data', {}).get(key),
|
||||
'question': value.label
|
||||
})
|
||||
if response:
|
||||
for key, value in response.items():
|
||||
p.additional_fields.append({
|
||||
'answer': data.get('question_form_data', {}).get(key),
|
||||
'question': value.label
|
||||
})
|
||||
|
||||
p.has_questions = (
|
||||
p.additional_fields or
|
||||
|
||||
Reference in New Issue
Block a user