Ticket #8509: testcookie_fix.diff

File testcookie_fix.diff, 793 bytes (added by Rajesh Dhawan, 16 years ago)

Admin testcookie delete fails in certain cases. Attached patch fixes this.

  • django/contrib/admin/sites.py

     
    275275                login(request, user)
    276276                if request.POST.has_key('post_data'):
    277277                    post_data = _decode_post_data(request.POST['post_data'])
    278                     request.session.delete_test_cookie()
     278                    if request.session.test_cookie_worked():
     279                        request.session.delete_test_cookie()
    279280                    if post_data and not post_data.has_key(LOGIN_FORM_KEY):
    280281                        # overwrite request.POST with the saved post_data, and continue
    281282                        request.POST = post_data
Back to Top