mirror of https://github.com/django/django.git
Fixed #8367 -- Pass the object to get_form from get_fieldsets in ModelAdmin. Thanks jarrow for catching this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8479 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
324befc477
commit
58c579b005
|
@ -247,7 +247,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||||
"Hook for specifying fieldsets for the add form."
|
"Hook for specifying fieldsets for the add form."
|
||||||
if self.declared_fieldsets:
|
if self.declared_fieldsets:
|
||||||
return self.declared_fieldsets
|
return self.declared_fieldsets
|
||||||
form = self.get_form(request)
|
form = self.get_form(request, obj)
|
||||||
return [(None, {'fields': form.base_fields.keys()})]
|
return [(None, {'fields': form.base_fields.keys()})]
|
||||||
|
|
||||||
def get_form(self, request, obj=None, **kwargs):
|
def get_form(self, request, obj=None, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue