summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-01-27 11:02:26 -0500
committerTim Graham <timograham@gmail.com>2018-01-27 11:03:41 -0500
commit92f48680dbd2e02f2b33f6ad0e35b7d337889fb2 (patch)
tree424037eca69b91970d93cfc8842c3afcaf3b96df /django
parenta455e732a0011dfbd15eddaa4fe60cb9439326e0 (diff)
Expanded docs for AbstractBaseUser.has_usable_password().
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/base_user.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py
index 0f8d5d87e2..357528e19e 100644
--- a/django/contrib/auth/base_user.py
+++ b/django/contrib/auth/base_user.py
@@ -115,6 +115,11 @@ class AbstractBaseUser(models.Model):
self.password = make_password(None)
def has_usable_password(self):
+ """
+ Return False if set_unusable_password() has been called for this user,
+ or if the password is None, or if the password uses a hasher that's not
+ in the PASSWORD_HASHERS setting.
+ """
return is_password_usable(self.password)
def get_session_auth_hash(self):