Commit d31edc44 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix error when saving

parent 2cee5f74
......@@ -50,10 +50,10 @@ class MultilingualField(object):
self.kwargs = kwargs
def _i18n_attr_accessor(attr):
def _i18n_attr_accessor(attr, lang):
def accessor(self):
return getattr(self, I18N_FIELD_FORMAT.format(attr, get_language()))
return getattr(self, I18N_FIELD_FORMAT.format(attr, lang))
return accessor
......@@ -95,7 +95,7 @@ class ModelTranslateMeta(models.base.ModelBase):
"by TranslateMeta.".format(attr_i18n))
dct[attr_i18n] = field.cls(*field.args, **field.kwargs)
dct[attr] = property(_i18n_attr_accessor(attr))
dct[attr] = property(_i18n_attr_accessor(attr, get_language()))
default = I18N_FIELD_FORMAT.format(attr, settings.LANGUAGE_CODE)
if default not in dct:
raise ImproperlyConfigured("LANGUAGE_CODE not in LANGUAGES.")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment