﻿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
26202	Admin Actions: response_action action_index will never work	Ben Cole	nobody	"Whilst trying to add action buttons (with name=""action"" and the action name as values) to the change list rows, I stumbled across the problem where despite adding a field to the changelist form called ""index"", submitting the form would always fail (even if selecting an action from the drop down first).

By debugging inside django.contrib.admin.options.response_action() I found there is some code that attempts to get the action from the request if it was in a list.

{{{#!python
# Use the action whose button was pushed
try:
    data.update({'action': data.getlist('action')[action_index]})
except IndexError:
    # If we didn't get an action from the chosen form that's invalid
    # POST data, so by deleting action it'll fail the validation check
    # below. So no need to do anything here
    pass
}}}

The trouble is, data is a QueryDict whose update method (by design) adds new value to existing keys by creating or appending to a list. This then causes the later form to fail validation.

I don't see why this needs to be an update, and in fact it should just be a key reassignment.
"	Bug	closed	contrib.admin	1.9	Normal	invalid			Unreviewed	0	0	0	0	0	0
