Ticket #12962: with_test_change-12812.diff

File with_test_change-12812.diff, 2.0 KB (added by Mark Lavin, 15 years ago)

ptone's patch with updated test

  • django/contrib/admin/options.py

     
    698698        changelist; it returns an HttpResponse if the action was handled, and
    699699        None otherwise.
    700700        """
    701         if 'index' not in request.POST:
    702             # If "Go" was not pushed then we can assume the POST was for
    703             # an inline edit save and we do not need to validate the form.
    704             return None
    705701
    706702        # There can be multiple action forms on the page (at the top
    707703        # and bottom of the change list, for example). Get the action
     
    978974            return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1')
    979975
    980976        # 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 POST
     977        # Try to look up an action or confirmation first, but if this isn't an action the POST
    982978        # 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):
    984980            response = self.response_action(request, queryset=cl.get_query_set())
    985981            if response:
    986982                return response
  • tests/regressiontests/admin_views/tests.py

     
    13401340        delete_confirmation_data = {
    13411341            ACTION_CHECKBOX_NAME: [1, 2],
    13421342            'action' : 'delete_selected',
    1343             'index': 0,
    13441343            'post': 'yes',
    13451344        }
    13461345        confirmation = self.client.post('/test_admin/admin/admin_views/subscriber/', action_data)
Back to Top