Skip to content

Commit

Permalink
Fixed use of dictionaries as values in Terms query (#1921) (#1925)
Browse files Browse the repository at this point in the history
Fixes #1920

(cherry picked from commit fb18f38)

Co-authored-by: Miguel Grinberg <[email protected]>
  • Loading branch information
github-actions[bot] and miguelgrinberg authored Oct 7, 2024
1 parent ee1dc8f commit b116175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/templates/query.py.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ EMPTY_QUERY = MatchAll()
{% elif k.name == "Terms" %}
def _setattr(self, name: str, value: Any) -> None:
# here we convert any iterables that are not strings to lists
if hasattr(value, "__iter__") and not isinstance(value, (str, list)):
if hasattr(value, "__iter__") and not isinstance(value, (str, list, dict)):
value = list(value)
super()._setattr(name, value)

Expand Down

0 comments on commit b116175

Please sign in to comment.