mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
fix: catch correct exception when parsing filter (#15458)
This commit is contained in:
parent
1b5cdf6bef
commit
c6223c076f
@ -1,5 +1,7 @@
|
||||
import re
|
||||
from functools import reduce
|
||||
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from pyparsing import (
|
||||
infixNotation,
|
||||
opAssoc,
|
||||
@ -353,7 +355,7 @@ class SmartFilter(object):
|
||||
|
||||
try:
|
||||
res = boolExpr.parseString('(' + filter_string + ')')
|
||||
except ParseException:
|
||||
except (ParseException, FieldDoesNotExist):
|
||||
raise RuntimeError(u"Invalid query %s" % filter_string_raw)
|
||||
|
||||
if len(res) > 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user