diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2010-03-20 14:53:17 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2010-03-20 14:53:17 +0000 |
| commit | 4528f3988689272d511b1395efc578c0b0d9e671 (patch) | |
| tree | 30303112955289f8e2411e0dfffe28b0080e1220 | |
| parent | 4f98a7c45f4ac65204f0c5e05bad5530d3dc4cc6 (diff) | |
Fixed #12962: Made admin delete action work again. Thanks ptone, skevy, mlavin and anyone else I've missed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/admin/options.py | 10 | ||||
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 2cda5d5d69..4504e9dbb3 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -698,10 +698,6 @@ class ModelAdmin(BaseModelAdmin): changelist; it returns an HttpResponse if the action was handled, and None otherwise. """ - if 'index' not in request.POST: - # If "Go" was not pushed then we can assume the POST was for - # an inline edit save and we do not need to validate the form. - return None # There can be multiple action forms on the page (at the top # and bottom of the change list, for example). Get the action @@ -978,9 +974,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 10bfff2092..280a89d41e 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -1340,7 +1340,6 @@ class AdminActionsTest(TestCase): delete_confirmation_data = { ACTION_CHECKBOX_NAME: [1, 2], 'action' : 'delete_selected', - 'index': 0, 'post': 'yes', } confirmation = self.client.post('/test_admin/admin/admin_views/subscriber/', action_data) |
