Ticket #3393: 3393_2.diff
File 3393_2.diff, 1.0 KB (added by , 17 years ago) |
---|
-
django/contrib/auth/views.py
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 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 = {}