mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Allow to show all vouchers with empty tags
This commit is contained in:
@@ -796,7 +796,10 @@ class VoucherFilterForm(FilterForm):
|
|||||||
|
|
||||||
if fdata.get('tag'):
|
if fdata.get('tag'):
|
||||||
s = fdata.get('tag').strip()
|
s = fdata.get('tag').strip()
|
||||||
qs = qs.filter(tag__icontains=s)
|
if s == '<>':
|
||||||
|
qs = qs.filter(Q(tag__isnull=True) | Q(tag=''))
|
||||||
|
else:
|
||||||
|
qs = qs.filter(tag__icontains=s)
|
||||||
|
|
||||||
if fdata.get('qm'):
|
if fdata.get('qm'):
|
||||||
s = fdata.get('qm')
|
s = fdata.get('qm')
|
||||||
|
|||||||
@@ -27,10 +27,17 @@
|
|||||||
{% for t in tags %}
|
{% for t in tags %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong><a
|
<strong>
|
||||||
href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ t.tag|urlencode }}">
|
{% if t.tag %}
|
||||||
{{ t.tag }}
|
<a href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ t.tag|urlencode }}">
|
||||||
</a></strong> <small>({{ t.redeemed }} / {{ t.total }})</small>
|
{{ t.tag }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ '<>'|urlencode }}">
|
||||||
|
{% trans "Empty tag" %}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</strong> <small>({{ t.redeemed }} / {{ t.total }})</small>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
|||||||
Reference in New Issue
Block a user