﻿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
33893	Admin add model page incorrectly redirects	Fabian Jarrett	Fabian Jarrett	"In the admin when clicking ""add model +"" I fill out the fields to create my item then when I click ""Save and add another"" or ""Save and continue editing"" it redirects back to the model list view even though the item was added successfully. If I click back on to the item to edit it the buttons work how they should.

Looks like ""_addanother"" isn't in the request.POST: https://github.com/django/django/blob/main/django/contrib/admin/options.py#L1388

The name on the input isn't being passed with the form submit: https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/submit_line.html#L6

If I comment out overriding the submit it works as expected: https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/change_form.js#L11:L19

Also when editing an item that has already been created ""modelName"" is undefined so the submit buttons don't get overridden: https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/change_form.js#L8
So works when editing, but not when adding a new item.

I think this change is causing the issue? https://github.com/django/django/commit/fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa"	Bug	closed	contrib.admin	4.1	Release blocker	fixed	admin	Carlton Gibson Marcelo Galigniana	Ready for checkin	1	0	0	0	0	0
