diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-11 18:17:42 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-11 18:17:42 +0200 | 
| commit | ee8bde746c028a08413f5dfc6f5021ffb6a0dd7a (patch) | |
| tree | 548c1f04a12b34c0d0f574424a25eed4dafcba6a /ishtar_common | |
| parent | a41c08039dc12e1ceb35e6c7eed55b1e4a8423ae (diff) | |
| download | Ishtar-ee8bde746c028a08413f5dfc6f5021ffb6a0dd7a.tar.bz2 Ishtar-ee8bde746c028a08413f5dfc6f5021ffb6a0dd7a.zip  | |
Fix search with only a "-" sign
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/views_item.py | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 133e27d39..98415c311 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -341,7 +341,7 @@ def _parse_query_string(string, request_keys, current_dct, exc_dct):                      dct[term] += u";" + query                  else:                      dct[term] = query -                return "" +                return u""      for reserved_char in FORBIDDEN_CHAR:          string = string.replace(reserved_char, u"")      if len(string) != 1: @@ -349,8 +349,12 @@ def _parse_query_string(string, request_keys, current_dct, exc_dct):              string = string.replace(reserved_char, u"")      # like search      if string.endswith(u'*'): +        if len(string.strip()) == 1: +            return u""          string = string[:-1] + u':*'      if string.startswith(u'-'): +        if len(string.strip()) == 1: +            return u""          string = u"!" + string[1:]      return string  | 
