Commits

Carl Meyer committed 50086e8

no mangling untranslated prepop fields

  • Participants
  • Parent commits 9322bd0
  • Branches tame_transadmin

Comments (0)

Files changed (1)

File modeltranslation/admin.py

         if self.prepopulated_fields:
             prepopulated_fields_new = dict(self.prepopulated_fields)
             for (k, v) in self.prepopulated_fields.items():
-                translation_fields = get_translation_fields(v[0])
-                prepopulated_fields_new[k] = tuple([translation_fields[0]])
+                if v[0] in trans_opts.fields:
+                    translation_fields = get_translation_fields(v[0])
+                    prepopulated_fields_new[k] = tuple([translation_fields[0]])
             self.prepopulated_fields = prepopulated_fields_new
 
     def formfield_for_dbfield(self, db_field, **kwargs):