Skip to content
Snippets Groups Projects
Commit fd5a9e39 authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Show all public answers of an order

parent 74be8781
No related branches found
No related tags found
No related merge requests found
...@@ -60,9 +60,7 @@ def add_public_registrations_table(sender, **kwargs): ...@@ -60,9 +60,7 @@ def add_public_registrations_table(sender, **kwargs):
] ]
answers = QuestionAnswer.objects.filter(orderposition__in=public_order_positions, question__in=public_questions) answers = QuestionAnswer.objects.filter(orderposition__in=public_order_positions, question__in=public_questions)
public_answers = { public_answers = {
a.orderposition_id: { (a.orderposition_id, a.question_id): a
a.question_id: a
}
for a in answers for a in answers
} }
public_registrations = [ public_registrations = [
...@@ -73,7 +71,7 @@ def add_public_registrations_table(sender, **kwargs): ...@@ -73,7 +71,7 @@ def add_public_registrations_table(sender, **kwargs):
) + ( ) + (
[pop.attendee_name_cached] if sender.settings.get('public_registrations_show_attendee_name') else [] [pop.attendee_name_cached] if sender.settings.get('public_registrations_show_attendee_name') else []
) + [ ) + [
public_answers[pop.pk][pq.pk].answer if public_answers.get(pop.pk, None) and public_answers[pop.pk].get(pq.pk, None) else '' public_answers[(pop.pk, pq.pk)].answer if public_answers.get((pop.pk, pq.pk)) else ''
for pq in public_questions for pq in public_questions
] ]
} for pop in public_order_positions } for pop in public_order_positions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment