diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 2071792..787cacd 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
343 | 343 | self.admin_site = admin_site |
344 | 344 | super(ModelAdmin, self).__init__() |
345 | 345 | |
346 | | def get_inline_instances(self, request): |
| 346 | def get_inline_instances(self, request, obj=None): |
347 | 347 | inline_instances = [] |
348 | 348 | for inline_class in self.inlines: |
349 | 349 | inline = inline_class(self.model, self.admin_site) |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
503 | 503 | fields=self.list_editable, **defaults) |
504 | 504 | |
505 | 505 | def get_formsets(self, request, obj=None): |
506 | | for inline in self.get_inline_instances(request): |
| 506 | for inline in self.get_inline_instances(request, obj): |
507 | 507 | yield inline.get_formset(request, obj) |
508 | 508 | |
509 | 509 | def get_paginator(self, request, queryset, per_page, orphans=0, allow_empty_first_page=True): |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
931 | 931 | |
932 | 932 | ModelForm = self.get_form(request) |
933 | 933 | formsets = [] |
934 | | inline_instances = self.get_inline_instances(request) |
| 934 | inline_instances = self.get_inline_instances(request, obj=None) |
935 | 935 | if request.method == 'POST': |
936 | 936 | form = ModelForm(request.POST, request.FILES) |
937 | 937 | if form.is_valid(): |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
1029 | 1029 | |
1030 | 1030 | ModelForm = self.get_form(request, obj) |
1031 | 1031 | formsets = [] |
1032 | | inline_instances = self.get_inline_instances(request) |
| 1032 | inline_instances = self.get_inline_instances(request, obj) |
1033 | 1033 | if request.method == 'POST': |
1034 | 1034 | form = ModelForm(request.POST, request.FILES, instance=obj) |
1035 | 1035 | if form.is_valid(): |