From b116175f87cd23267dbfe963999c4cc87526b87a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:41:55 +0100 Subject: [PATCH] Fixed use of dictionaries as values in Terms query (#1921) (#1925) Fixes #1920 (cherry picked from commit fb18f383adbe5379ecc02b092fe8a5c126a7c8a4) Co-authored-by: Miguel Grinberg --- utils/templates/query.py.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/templates/query.py.tpl b/utils/templates/query.py.tpl index 23b23809..ca95f5a0 100644 --- a/utils/templates/query.py.tpl +++ b/utils/templates/query.py.tpl @@ -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)