Get language getting from the field attribute rather than name.

The method seems to be not used anymore, but fix it nevertheless.
This commit is contained in:
Jacek Tomaszewski 2014-10-24 20:23:10 +02:00
parent af672f3160
commit 369293b14d

View file

@ -219,8 +219,7 @@ class TranslationBaseModelAdmin(BaseModelAdmin):
exclude = []
for orig_fieldname, translation_fields in self.trans_opts.fields.items():
for tfield in translation_fields:
language = tfield.name.split('_')[-1]
if language in excl_languages and tfield not in exclude:
if tfield.language in excl_languages and tfield not in exclude:
exclude.append(tfield)
return tuple(exclude)