fix(convert_to_value): convert dict_keys and dict_values to a tuple as well

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-11-12 12:33:53 +05:30
parent a9d0abaf7b
commit bd48f5df65
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -3,6 +3,7 @@
import re
import string
from collections.abc import KeysView, ValuesView
from functools import cached_property, wraps
import frappe
@ -33,7 +34,7 @@ def convert_to_value(o: FilterValue):
return int(o)
elif isinstance(o, dict):
return frappe.as_json(o)
elif isinstance(o, (list, tuple, set)):
elif isinstance(o, (list, tuple, set, KeysView, ValuesView)):
return tuple(convert_to_value(item) for item in o)
return o