mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-03 02:54:42 +00:00
Fixed mangling of untranslated prepopulated fields. Resolves issue 25 (thanks to carl.j.meyer).
This commit is contained in:
parent
76e04858cd
commit
ae8c116c29
2 changed files with 5 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
|||
FIXED: Mangling of untranslated prepopulated fields
|
||||
(thanks to carl.j.meyer, resolves issue 25).
|
||||
FIXED: Verbose names of translated fields are not translated.
|
||||
(thanks to carl.j.meyer, resolves issue 24).
|
||||
FIXED: Race condition between model import and translation registration in
|
||||
|
|
|
|||
|
|
@ -90,8 +90,9 @@ class TranslationAdmin(admin.ModelAdmin, TranslationAdminBase):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue