Commit 2b62e945 authored by Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss
Browse files

Fixed #3393: login view no longer assumes that set_test_cookie has been...

Fixed #3393: login view no longer assumes that set_test_cookie has been called. This is mildly backwards-incompatible, but in the "now it works the way it should have all along" sense. Thanks to James and lcordier for the patches.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent c5f7caba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ answer newbie questions, and generally made Django that much better:
    Nicola Larosa <nico@teknico.net>
    Rune Rønde Laursen <runerl@skjoldhoej.dk>
    Eugene Lazutkin <http://lazutkin.com/blog/>
    lcordier@point45.com
    Jeong-Min Lee <falsetru@gmail.com>
    Jannis Leidel <jl@websushi.org>
    Christopher Lenz <http://www.cmlenz.net/>
+3 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ from django.utils.translation import ugettext as _

def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
    "Displays the login form and handles the login action."
    manipulator = AuthenticationForm(request)
    manipulator = AuthenticationForm()
    redirect_to = request.REQUEST.get(redirect_field_name, '')
    if request.POST:
        errors = manipulator.get_validation_errors(request.POST)
@@ -22,6 +22,7 @@ def login(request, template_name='registration/login.html', redirect_field_name=
                redirect_to = settings.LOGIN_REDIRECT_URL
            from django.contrib.auth import login
            login(request, manipulator.get_user())
            if request.session.test_cookie_worked():
                request.session.delete_test_cookie()
            return HttpResponseRedirect(redirect_to)
    else: