diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index f5f6256..e6749ba 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
345 | 345 | self.admin_site = admin_site |
346 | 346 | super(ModelAdmin, self).__init__() |
347 | 347 | |
348 | | def get_inline_instances(self, request): |
| 348 | def get_inline_instances(self, request, obj=None): |
349 | 349 | inline_instances = [] |
350 | 350 | for inline_class in self.inlines: |
351 | 351 | inline = inline_class(self.model, self.admin_site) |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
505 | 505 | fields=self.list_editable, **defaults) |
506 | 506 | |
507 | 507 | def get_formsets(self, request, obj=None): |
508 | | for inline in self.get_inline_instances(request): |
| 508 | for inline in self.get_inline_instances(request, obj): |
509 | 509 | yield inline.get_formset(request, obj) |
510 | 510 | |
511 | 511 | def get_paginator(self, request, queryset, per_page, orphans=0, allow_empty_first_page= |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
1031 | 1031 | |
1032 | 1032 | ModelForm = self.get_form(request, obj) |
1033 | 1033 | formsets = [] |
1034 | | inline_instances = self.get_inline_instances(request) |
| 1034 | inline_instances = self.get_inline_instances(request, obj) |
1035 | 1035 | if request.method == 'POST': |
1036 | 1036 | form = ModelForm(request.POST, request.FILES, instance=obj) |
1037 | 1037 | if form.is_valid(): |