﻿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
24348	Allow to pass on initial data to change form for existing objects (again).	slachinger	nobody	"The scenario is to redirect the user to the change_view to review changes to an existing object before saving. For this the data for the changed fields needs to be passed on via GET-Parameters. This still works for ""add"" but no longer works for ""change"".

This worked/existed until 1.6 but no longer works in 1.7. I suspect this is related to the introduction of ModelAdmin.get_changeform_initial_data() method and the cleanup/optimization that came with it.

Based on the code from 1.7.2 in django/contrib/admin/options.py:1414-1420:

Maybe call self.get_changeform_initial_data(request) for both change and add and pass on the object (or none for add)?
{{{
#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python
            if add:
                initial = self.get_changeform_initial_data(request, obj=None) # <- /add so obj=None
                form = ModelForm(initial=initial)
                formsets, inline_instances = self._create_formsets(request, self.model(), change=False)
            else:
                initial = self.get_changeform_initial_data(request, obj=obj) # <- maybe add this line?
                form = ModelForm(instance=obj)
                formsets, inline_instances = self._create_formsets(request, obj, change=True)
  }}}
}}}

The change in the method signature might break code overriding get_changeform_initial_data() though.

"	New feature	new	contrib.admin	1.7	Normal			simon.lachinger@…	Unreviewed	0	0	0	0	0	0
