diff options
author | Sanmugasundaram K | 2015-02-19 18:09:05 +0530 |
---|---|---|
committer | Sanmugasundaram K | 2015-02-19 18:09:05 +0530 |
commit | d8637a58a13f4cfa1789e703d17f8f2e14116873 (patch) | |
tree | 9855446e3ebacc57c8788892f199baa9ea726b58 /spoken_auth | |
parent | 911fbd1637efcec8bfacec3d658213e910845a93 (diff) | |
download | spoken-tutorial-forums-d8637a58a13f4cfa1789e703d17f8f2e14116873.tar.gz spoken-tutorial-forums-d8637a58a13f4cfa1789e703d17f8f2e14116873.tar.bz2 spoken-tutorial-forums-d8637a58a13f4cfa1789e703d17f8f2e14116873.zip |
Restrict disabled user from login
Diffstat (limited to 'spoken_auth')
-rw-r--r-- | spoken_auth/backends.py | 2 | ||||
-rw-r--r-- | spoken_auth/models.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/spoken_auth/backends.py b/spoken_auth/backends.py index a46ea80..d69d1c7 100644 --- a/spoken_auth/backends.py +++ b/spoken_auth/backends.py @@ -11,7 +11,7 @@ class DrupalAuthBackend(object): def authenticate(self, username=None, password=None): user_logged_in.disconnect(update_last_login) try: - user = User.objects.get(username=username) + user = User.objects.get(username=username, is_active=True) if user.check_password(password): return user return None diff --git a/spoken_auth/models.py b/spoken_auth/models.py index 431330d..c2fbb6b 100644 --- a/spoken_auth/models.py +++ b/spoken_auth/models.py @@ -9,6 +9,7 @@ class Users(AbstractBaseUser): id = models.IntegerField(primary_key=True) username = models.CharField(max_length=100L, unique=True) email = models.CharField(max_length=100L, unique=True) + is_active = models.BooleanField() USERNAME_FIELD = 'username' class Meta: db_table = 'auth_user' |