Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2826 -- Added .is_authenticated() check before login() in comm…

…ents views

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3929 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6b384e828d72b518a40e9d555e3c107bd5288b45 1 parent 41d903b
Adrian Holovaty authored October 24, 2006
2  django/contrib/comments/views/comments.py
@@ -217,7 +217,7 @@ def post_comment(request):
217 217
     errors = manipulator.get_validation_errors(new_data)
218 218
     # If user gave correct username/password and wasn't already logged in, log them in
219 219
     # so they don't have to enter a username/password again.
220  
-    if manipulator.get_user() and new_data.has_key('password') and manipulator.get_user().check_password(new_data['password']):
  220
+    if manipulator.get_user() and not manipulator.get_user().is_authenticated() and new_data.has_key('password') and manipulator.get_user().check_password(new_data['password']):
221 221
         from django.contrib.auth import login
222 222
         login(request, manipulator.get_user())
223 223
     if errors or request.POST.has_key('preview'):

0 notes on commit 6b384e8

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