diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index f29c6a7299..d4b3d4de0e 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -665,6 +665,7 @@ class ModelAdmin(BaseModelAdmin): changelist; it returns an HttpResponse if the action was handled, and None otherwise. """ + # There can be multiple action forms on the page (at the top # and bottom of the change list, for example). Get the action # whose button was pushed. @@ -916,9 +917,9 @@ class ModelAdmin(BaseModelAdmin): return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1') # If the request was POSTed, this might be a bulk action or a bulk edit. - # Try to look up an action first, but if this isn't an action the POST - # will fall through to the bulk edit check, below. - if actions and request.method == 'POST': + # Try to look up an action or confirmation first, but if this isn't an + # action the POST will fall through to the bulk edit check, below. + if actions and request.method == 'POST' and (helpers.ACTION_CHECKBOX_NAME in request.POST or 'index' in request.POST): response = self.response_action(request, queryset=cl.get_query_set()) if response: return response diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 756cb18f4d..129f93cdac 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -1025,6 +1025,28 @@ class AdminViewListEditable(TestCase): # 1 select per object = 3 selects self.failUnlessEqual(response.content.count("