Fix a bug in I18FormField

This commit is contained in:
Raphael Michel
2015-04-05 22:53:25 +02:00
parent 072744e5c8
commit f563217529

View File

@@ -59,9 +59,11 @@ class I18nWidget(forms.MultiWidget):
for lng in self.langcodes():
data.append(
value.data[lng]
if value is not None and value.data is not None and lng in value.data
if value is not None and isinstance(value.data, dict) and lng in value.data
else None
)
if not isinstance(value.data, dict):
data[0] = value.data
return data
def format_output(self, rendered_widgets):