Ticket #12962: with_test_change-12812.diff
File with_test_change-12812.diff, 2.0 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/options.py
698 698 changelist; it returns an HttpResponse if the action was handled, and 699 699 None otherwise. 700 700 """ 701 if 'index' not in request.POST:702 # If "Go" was not pushed then we can assume the POST was for703 # an inline edit save and we do not need to validate the form.704 return None705 701 706 702 # There can be multiple action forms on the page (at the top 707 703 # and bottom of the change list, for example). Get the action … … 978 974 return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1') 979 975 980 976 # If the request was POSTed, this might be a bulk action or a bulk edit. 981 # Try to look up an action first, but if this isn't an action the POST977 # Try to look up an action or confirmation first, but if this isn't an action the POST 982 978 # will fall through to the bulk edit check, below. 983 if actions and request.method == 'POST' :979 if actions and request.method == 'POST' and (helpers.ACTION_CHECKBOX_NAME in request.POST or 'index' in request.POST): 984 980 response = self.response_action(request, queryset=cl.get_query_set()) 985 981 if response: 986 982 return response -
tests/regressiontests/admin_views/tests.py
1340 1340 delete_confirmation_data = { 1341 1341 ACTION_CHECKBOX_NAME: [1, 2], 1342 1342 'action' : 'delete_selected', 1343 'index': 0,1344 1343 'post': 'yes', 1345 1344 } 1346 1345 confirmation = self.client.post('/test_admin/admin/admin_views/subscriber/', action_data)