mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix #256 -- Allow exact filtering of voucher tags
This commit is contained in:
@@ -1439,6 +1439,8 @@ class VoucherFilterForm(FilterForm):
|
|||||||
s = fdata.get('tag').strip()
|
s = fdata.get('tag').strip()
|
||||||
if s == '<>':
|
if s == '<>':
|
||||||
qs = qs.filter(Q(tag__isnull=True) | Q(tag=''))
|
qs = qs.filter(Q(tag__isnull=True) | Q(tag=''))
|
||||||
|
elif s[0] == '"' and s[-1] == '"':
|
||||||
|
qs = qs.filter(tag__iexact=s[1:-1])
|
||||||
else:
|
else:
|
||||||
qs = qs.filter(tag__icontains=s)
|
qs = qs.filter(tag__icontains=s)
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<strong>
|
<strong>
|
||||||
{% if t.tag %}
|
{% if t.tag %}
|
||||||
<a href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ t.tag|urlencode }}">
|
<a href="{% url "control:event.vouchers" organizer=request.event.organizer.slug event=request.event.slug %}?tag={{ '"'|add:t.tag|add:'"'|urlencode }}">
|
||||||
{{ t.tag }}
|
{{ t.tag }}
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user