Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3393: login view no longer assumes that set_test_cookie has be…

…en 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
  • Loading branch information...
commit 2b62e945b09ef56e5a28389ad049deec1c347cec 1 parent c5f7cab
Jacob Kaplan-Moss authored June 18, 2008
1  AUTHORS
@@ -228,6 +228,7 @@ answer newbie questions, and generally made Django that much better:
228 228
     Nicola Larosa <nico@teknico.net>
229 229
     Rune Rønde Laursen <runerl@skjoldhoej.dk>
230 230
     Eugene Lazutkin <http://lazutkin.com/blog/>
  231
+    lcordier@point45.com
231 232
     Jeong-Min Lee <falsetru@gmail.com>
232 233
     Jannis Leidel <jl@websushi.org>
233 234
     Christopher Lenz <http://www.cmlenz.net/>
5  django/contrib/auth/views.py
@@ -11,7 +11,7 @@
11 11
 
12 12
 def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
13 13
     "Displays the login form and handles the login action."
14  
-    manipulator = AuthenticationForm(request)
  14
+    manipulator = AuthenticationForm()
15 15
     redirect_to = request.REQUEST.get(redirect_field_name, '')
16 16
     if request.POST:
17 17
         errors = manipulator.get_validation_errors(request.POST)
@@ -22,7 +22,8 @@ def login(request, template_name='registration/login.html', redirect_field_name=
22 22
                 redirect_to = settings.LOGIN_REDIRECT_URL
23 23
             from django.contrib.auth import login
24 24
             login(request, manipulator.get_user())
25  
-            request.session.delete_test_cookie()
  25
+            if request.session.test_cookie_worked():
  26
+                request.session.delete_test_cookie()
26 27
             return HttpResponseRedirect(redirect_to)
27 28
     else:
28 29
         errors = {}

0 notes on commit 2b62e94

Please sign in to comment.
Something went wrong with that request. Please try again.