diff --git a/awx/main/utils/filters.py b/awx/main/utils/filters.py index 5442a329a1..2310361f88 100644 --- a/awx/main/utils/filters.py +++ b/awx/main/utils/filters.py @@ -1,5 +1,4 @@ import re -import sys from pyparsing import ( infixNotation, opAssoc, @@ -15,9 +14,6 @@ from awx.main.utils.common import get_search_fields __all__ = ['SmartFilter'] -unicode_spaces = [unichr(c) for c in xrange(sys.maxunicode) if unichr(c).isspace()] -unicode_spaces_other = unicode_spaces + [u'(', u')', u'=', u'"'] - def string_to_type(t): if t == u'true': @@ -213,6 +209,8 @@ class SmartFilter(object): filter_string_raw = filter_string filter_string = unicode(filter_string) + unicode_spaces = list(set(unicode(c) for c in filter_string if c.isspace())) + unicode_spaces_other = unicode_spaces + [u'(', u')', u'=', u'"'] atom = CharsNotIn(unicode_spaces_other) atom_inside_quotes = CharsNotIn(u'"') atom_quoted = Literal('"') + Optional(atom_inside_quotes) + Literal('"')