Use tuple in Dict value instead of list
issue10715 review371771002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Use tuple in Dict value instead of list
|
||||
* Do not set record name on title of report get_email
|
||||
* Add node to id of status
|
||||
* Use ImmutableDict for Transaction context
|
||||
|
||||
@@ -42,6 +42,9 @@ class Dict(Field):
|
||||
# If stored as JSON conversion is done on backend
|
||||
if isinstance(data, str):
|
||||
data = json.loads(data, object_hook=JSONDecoder())
|
||||
for key, val in data.items():
|
||||
if isinstance(val, list):
|
||||
data[key] = tuple(val)
|
||||
dicts[value['id']] = ImmutableDict(data)
|
||||
return dicts
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ class FieldDictTestCase(unittest.TestCase):
|
||||
'dico': {'countries': ['fr', 'be']},
|
||||
}])
|
||||
|
||||
self.assertDictEqual(dict_.dico, {'countries': ['be', 'fr']})
|
||||
self.assertDictEqual(dict_.dico, {'countries': ('be', 'fr')})
|
||||
|
||||
@with_transaction()
|
||||
def test_invalid_selection_schema(self):
|
||||
|
||||
Reference in New Issue
Block a user