forked from CGM_Public/pretix_original
Allow to show all vouchers with empty tags
This commit is contained in:
@@ -796,7 +796,10 @@ class VoucherFilterForm(FilterForm):
|
||||
|
||||
if fdata.get('tag'):
|
||||
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'):
|
||||
s = fdata.get('qm')
|
||||
|
||||
@@ -27,10 +27,17 @@
|
||||
{% for t in tags %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong><a
|
||||
href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ t.tag|urlencode }}">
|
||||
{{ t.tag }}
|
||||
</a></strong> <small>({{ t.redeemed }} / {{ t.total }})</small>
|
||||
<strong>
|
||||
{% if t.tag %}
|
||||
<a href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ t.tag|urlencode }}">
|
||||
{{ 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>
|
||||
<div class="progress">
|
||||
|
||||
Reference in New Issue
Block a user