Do not uniquely sort list in Dict field without schema

When there is no schema, the list values are not for a MultiSelection entry.

Closes #12417
(grafted from aedd6a22eabc62538664c0127739ac02acd8f429)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-07-19 22:02:49 +02:00
1 parent 34dd5b884a
commit b6bf82de3d
1 file changed
+2 -2
+2 -2
View File
@@ -71,7 +71,7 @@ class Dict(Field):
for k, v in value.items():
if v is None:
continue
if isinstance(v, list):
if self.schema_model and isinstance(v, (list, tuple)):
v = list(sorted(set(v)))
d[k] = v
value = dumps(d)
@@ -106,7 +106,7 @@ class Dict(Field):
value = int(value)
if isinstance(value, (Select, CombiningQuery)):
return value
if isinstance(value, (list, tuple)):
if self.schema_model and isinstance(value, (list, tuple)):
value = sorted(set(value))
if operator.endswith('in'):
return [dumps(v) for v in value]