mirror of
https://github.com/pretix/pretix.git
synced 2026-09-13 16:14:40 +00:00
Fix #712 -- by default show answers by paid and pending orders
This commit is contained in:
@@ -16,9 +16,10 @@
|
|||||||
<form class="form-inline helper-display-inline" action="" method="get">
|
<form class="form-inline helper-display-inline" action="" method="get">
|
||||||
<p>
|
<p>
|
||||||
<select name="status" class="form-control">
|
<select name="status" class="form-control">
|
||||||
<option value="">{% trans "All orders" %}</option>
|
<option value="" {% if request.GET.status == "" %}selected="selected"{% endif %}>{% trans "All orders" %}</option>
|
||||||
<option value="p" {% if request.GET.status == "p" %}selected="selected"{% endif %}>{% trans "Paid" %}</option>
|
<option value="p" {% if request.GET.status == "p" %}selected="selected"{% endif %}>{% trans "Paid" %}</option>
|
||||||
<option value="n" {% if request.GET.status == "n" %}selected="selected"{% endif %}>{% trans "Pending" %}</option>
|
<option value="n" {% if request.GET.status == "n" %}selected="selected"{% endif %}>{% trans "Pending" %}</option>
|
||||||
|
<option value="np" {% if request.GET.status == "np" or "status" not in request.GET %}selected="selected"{% endif %}>{% trans "Pending or paid" %}</option>
|
||||||
<option value="o" {% if request.GET.status == "o" %}selected="selected"{% endif %}>{% trans "Pending (overdue)" %}</option>
|
<option value="o" {% if request.GET.status == "o" %}selected="selected"{% endif %}>{% trans "Pending (overdue)" %}</option>
|
||||||
<option value="e" {% if request.GET.status == "e" %}selected="selected"{% endif %}>{% trans "Expired" %}</option>
|
<option value="e" {% if request.GET.status == "e" %}selected="selected"{% endif %}>{% trans "Expired" %}</option>
|
||||||
<option value="ne" {% if request.GET.status == "ne" %}selected="selected"{% endif %}>{% trans "Pending or expired" %}</option>
|
<option value="ne" {% if request.GET.status == "ne" %}selected="selected"{% endif %}>{% trans "Pending or expired" %}</option>
|
||||||
|
|||||||
@@ -402,11 +402,13 @@ class QuestionView(EventPermissionRequiredMixin, QuestionMixin, ChartContainingV
|
|||||||
question=self.object, orderposition__isnull=False,
|
question=self.object, orderposition__isnull=False,
|
||||||
orderposition__order__event=self.request.event
|
orderposition__order__event=self.request.event
|
||||||
)
|
)
|
||||||
if self.request.GET.get("status", "") != "":
|
if self.request.GET.get("status", "np") != "":
|
||||||
s = self.request.GET.get("status", "")
|
s = self.request.GET.get("status", "np")
|
||||||
if s == 'o':
|
if s == 'o':
|
||||||
qs = qs.filter(orderposition__order__status=Order.STATUS_PENDING,
|
qs = qs.filter(orderposition__order__status=Order.STATUS_PENDING,
|
||||||
expires__lt=now().replace(hour=0, minute=0, second=0))
|
orderposition__order__expires__lt=now().replace(hour=0, minute=0, second=0))
|
||||||
|
elif s == 'np':
|
||||||
|
qs = qs.filter(orderposition__order__status__in=[Order.STATUS_PENDING, Order.STATUS_PAID])
|
||||||
elif s == 'ne':
|
elif s == 'ne':
|
||||||
qs = qs.filter(orderposition__order__status__in=[Order.STATUS_PENDING, Order.STATUS_EXPIRED])
|
qs = qs.filter(orderposition__order__status__in=[Order.STATUS_PENDING, Order.STATUS_EXPIRED])
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user