Django

Code

Changeset 7692

Show
Ignore:
Timestamp:
06/18/08 11:13:14 (2 months ago)
Author:
jacob
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r7598 r7692  
    229229    Rune RÞnde Laursen <runerl@skjoldhoej.dk> 
    230230    Eugene Lazutkin <http://lazutkin.com/blog/> 
     231    lcordier@point45.com 
    231232    Jeong-Min Lee <falsetru@gmail.com> 
    232233    Jannis Leidel <jl@websushi.org> 
  • django/trunk/django/contrib/auth/views.py

    r6206 r7692  
    1212def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME): 
    1313    "Displays the login form and handles the login action." 
    14     manipulator = AuthenticationForm(request
     14    manipulator = AuthenticationForm(
    1515    redirect_to = request.REQUEST.get(redirect_field_name, '') 
    1616    if request.POST: 
     
    2323            from django.contrib.auth import login 
    2424            login(request, manipulator.get_user()) 
    25             request.session.delete_test_cookie() 
     25            if request.session.test_cookie_worked(): 
     26                request.session.delete_test_cookie() 
    2627            return HttpResponseRedirect(redirect_to) 
    2728    else: