mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Sort answers according to questions order
* Sort answers according to questions (Z#23212280) * Undo ordering in Meta-class * filter and order answers only on invoice
This commit is contained in:
committed by
GitHub
parent
cd450f1780
commit
ee4e7f618f
@@ -258,9 +258,15 @@ def build_invoice(invoice: Invoice) -> Invoice:
|
||||
if resp:
|
||||
desc += "<br/>" + resp
|
||||
|
||||
for answ in p.answers.all():
|
||||
if not answ.question.print_on_invoice:
|
||||
continue
|
||||
answers_qs = p.answers.filter(
|
||||
question__print_on_invoice=True
|
||||
).select_related(
|
||||
'question'
|
||||
).order_by(
|
||||
'question__position',
|
||||
'question__id'
|
||||
)
|
||||
for answ in answers_qs:
|
||||
desc += "<br />{}{} {}".format(
|
||||
answ.question.question,
|
||||
"" if str(answ.question.question).endswith("?") else ":",
|
||||
|
||||
Reference in New Issue
Block a user