Skip to content

Commit

Permalink
fix: catch correct exception when parsing filter (#15458)
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 authored Aug 22, 2024
1 parent 1b5cdf6 commit c6223c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion awx/main/utils/filters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import re
from functools import reduce

from django.core.exceptions import FieldDoesNotExist
from pyparsing import (
infixNotation,
opAssoc,
Expand Down Expand Up @@ -353,7 +355,7 @@ def query_from_string(cls, filter_string):

try:
res = boolExpr.parseString('(' + filter_string + ')')
except ParseException:
except (ParseException, FieldDoesNotExist):
raise RuntimeError(u"Invalid query %s" % filter_string_raw)

if len(res) > 0:
Expand Down

0 comments on commit c6223c0

Please sign in to comment.