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 | 955245a7083c2b3e00daba667d541ab1785603ce (patch) | |
tree | 548c1f04a12b34c0d0f574424a25eed4dafcba6a /ishtar_common | |
parent | 46fc477e41be542853abd198a87a54215460d2d6 (diff) | |
download | Ishtar-955245a7083c2b3e00daba667d541ab1785603ce.tar.bz2 Ishtar-955245a7083c2b3e00daba667d541ab1785603ce.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 |