Harden search filter
* hardens search filter against whitespaces * renames 'Show all' filter to 'Show unshared' for clarification * adds translation
This commit is contained in:
@@ -21,7 +21,7 @@ class InterventionTableFilter(django_filters.FilterSet):
|
||||
)
|
||||
sa = django_filters.BooleanFilter(
|
||||
method='_filter_show_all',
|
||||
label=_("Show all"),
|
||||
label=_("Show unshared"),
|
||||
label_suffix=_(""),
|
||||
widget=forms.CheckboxInput()
|
||||
)
|
||||
@@ -72,6 +72,7 @@ class InterventionTableFilter(django_filters.FilterSet):
|
||||
Returns:
|
||||
|
||||
"""
|
||||
value = value.strip()
|
||||
# build filter expression
|
||||
q = Q(title__icontains=value) | Q(identifier__icontains=value)
|
||||
return queryset.filter(q)
|
||||
|
||||
Reference in New Issue
Block a user