Fixing I18NJsonField for a not covered scenario with None data

remotes/origin/enhancement/email-actions
Alejandro Alonso 2015-06-09 10:33:57 +02:00
parent 29694b8e21
commit a77f21776f
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ class I18NJsonField(JsonField):
def translate_values(self, d): def translate_values(self, d):
i18n_d = {} i18n_d = {}
if d is None:
return d
for key, value in d.items(): for key, value in d.items():
if isinstance(value, dict): if isinstance(value, dict):
i18n_d[key] = self.translate_values(value) i18n_d[key] = self.translate_values(value)