From ee8bde746c028a08413f5dfc6f5021ffb6a0dd7a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 11 Sep 2018 18:17:42 +0200 Subject: Fix search with only a "-" sign --- ishtar_common/views_item.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common') 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 -- cgit v1.2.3