mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-24 12:13:45 +00:00
commit
30c953aa02
1 changed files with 4 additions and 3 deletions
|
|
@ -184,12 +184,13 @@ class TranslationBaseModelAdmin(BaseModelAdmin):
|
|||
"""
|
||||
Generic code shared by get_form and get_formset.
|
||||
"""
|
||||
if self.exclude is None:
|
||||
exclude = self.get_exclude(request, obj)
|
||||
if exclude is None:
|
||||
exclude = []
|
||||
else:
|
||||
exclude = list(self.exclude)
|
||||
exclude = list(exclude)
|
||||
exclude.extend(self.get_readonly_fields(request, obj))
|
||||
if not self.exclude and hasattr(self.form, '_meta') and self.form._meta.exclude:
|
||||
if not exclude and hasattr(self.form, '_meta') and self.form._meta.exclude:
|
||||
# Take the custom ModelForm's Meta.exclude into account only if the
|
||||
# ModelAdmin doesn't define its own.
|
||||
exclude.extend(self.form._meta.exclude)
|
||||
|
|
|
|||
Loading…
Reference in a new issue