Removed redundant model instantiation in contrib.admin; refs #11390.

This commit is contained in:
TomV 2015-03-22 20:32:46 +00:00 committed by Tim Graham
parent b4382b7055
commit a4a58811b9
1 changed files with 1 additions and 1 deletions

View File

@ -1387,7 +1387,7 @@ class ModelAdmin(BaseModelAdmin):
if add:
initial = self.get_changeform_initial_data(request)
form = ModelForm(initial=initial)
formsets, inline_instances = self._create_formsets(request, self.model(), change=False)
formsets, inline_instances = self._create_formsets(request, form.instance, change=False)
else:
form = ModelForm(instance=obj)
formsets, inline_instances = self._create_formsets(request, obj, change=True)