From 1d77eb293e680e60f8035fcbf592e115ab7b56bb Mon Sep 17 00:00:00 2001 From: mipel Date: Wed, 28 Jul 2021 08:54:48 +0200 Subject: [PATCH] Harden search filter * hardens search filter against whitespaces * renames 'Show all' filter to 'Show unshared' for clarification * adds translation --- intervention/filters.py | 3 ++- locale/de/LC_MESSAGES/django.mo | Bin 9098 -> 9117 bytes locale/de/LC_MESSAGES/django.po | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/intervention/filters.py b/intervention/filters.py index 0a56b36b..dfef2ac0 100644 --- a/intervention/filters.py +++ b/intervention/filters.py @@ -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) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 67390c8eae4f5e8f013a5d8f10fe45cb3343baf9..834639e86ea7e240611a883c3906185988f272bc 100644 GIT binary patch delta 1412 zcmXZbOGwmF6vy#9KFV>L($vXPYev(wQVX&eY*Ate_5cwoH-(SUagowg8l_E?n}Ui^ zu?UNb9%Kt;tVOFJ3Q@$O7HL6A1}!2Y72ITff6RqH|IfY0|J-}dx!21T{S|{Vv0=9{ zrYO}Ixf7RRC3^7?#^Y)0IZR^Sh5Ei1kVN45U0{rfxA5l*7+ z$`>1-K?)0-pA5JkW*+IXNu+>zF8r7*rRA-K%HfXbUpc1`++VCo>lijFG z+lM-e2k2sdGt7W)o0q7{r%<>27jnoC?NCB~>poP6j`Grmov6ET2@7x#x8M{O zqHArmGk)C4ycv_&-`rxLil3rd{T$WWSE$a6VKRP2wfGOJk{JHSbQDRb#PU#y_^o@8 z$5ioBV#iV6-LUZi4385SW1v>v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a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 615a0a78..50a51f77 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-28 08:48+0200\n" +"POT-Creation-Date: 2021-07-28 08:51+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -122,8 +122,8 @@ msgid "Payment removed" msgstr "Zahlung gelöscht" #: intervention/filters.py:24 -msgid "Show all" -msgstr "Alle anzeigen" +msgid "Show unshared" +msgstr "Nicht freigegebene anzeigen" #: intervention/filters.py:30 msgid "Show recorded" @@ -1866,6 +1866,9 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "Show all" +#~ msgstr "Alle anzeigen" + #~ msgid "This will remove '{}'. Are you sure?" #~ msgstr "Hiermit wird '{}' gelöscht. Sind Sie sicher?"