﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33527	remove unnecessary code from patch before in ModelAdmin inlines save.	Maxim Danilov	nobody	"In #33111, the following code was added:

{{{
form = ModelForm(request.POST, request.FILES, instance=obj)
formsets, inline_instances = self._create_formsets(request, form.instance if add else obj, change=not add)
}}}

it is all ok, but if we have:
{{{
form = ModelForm(request.POST, request.FILES, instance=obj)
}}}
this is superabundant:
{{{
form.instance if add else obj
}}}
I think, it should be:
{{{
form = ModelForm(request.POST, request.FILES, instance=obj)
formsets, inline_instances = self._create_formsets(request, form.instance, change=not add)
# or # formsets, inline_instances = self._create_formsets(request, obj, change=not add)
}}}

The same changes is possible to made in code-block for request.GET"	Cleanup/optimization	new	contrib.admin	4.0	Normal		modeladmin, inlinemodel		Unreviewed	0	0	0	0	1	0
