mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Removed redundant model instantiation in contrib.admin; refs #11390.
This commit is contained in:
parent
b4382b7055
commit
a4a58811b9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user