Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1991 -- Changed AuthenticationForm to disallow users with is_a…

…ctive=False from logging in. Thanks, dave@rightround.com and germish@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 16a07fe95b7bc23c8dddd7ffbf85a150a2a57d9d 1 parent bd5b350
Adrian Holovaty authored June 02, 2006

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  django/contrib/auth/forms.py
6  django/contrib/auth/forms.py
@@ -36,9 +36,13 @@ def isValidUser(self, field_data, all_data):
36 36
             raise validators.ValidationError, _("Please enter a correct username and password. Note that both fields are case-sensitive.")
37 37
 
38 38
     def isValidPasswordForUser(self, field_data, all_data):
39  
-        if self.user_cache is not None and not self.user_cache.check_password(field_data):
  39
+        if self.user_cache is None:
  40
+            return
  41
+        if not self.user_cache.check_password(field_data):
40 42
             self.user_cache = None
41 43
             raise validators.ValidationError, _("Please enter a correct username and password. Note that both fields are case-sensitive.")
  44
+        elif not self.user_cache.is_active:
  45
+            raise validators.ValidationError, _("This account is inactive.")
42 46
 
43 47
     def get_user_id(self):
44 48
         if self.user_cache:

0 notes on commit 16a07fe

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