summaryrefslogtreecommitdiff
path: root/django/contrib/auth/base_user.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/auth/base_user.py')
-rw-r--r--django/contrib/auth/base_user.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py
index de069659e1..9ad5cde87f 100644
--- a/django/contrib/auth/base_user.py
+++ b/django/contrib/auth/base_user.py
@@ -138,5 +138,12 @@ class AbstractBaseUser(models.Model):
return salted_hmac(key_salt, self.password).hexdigest()
@classmethod
+ def get_email_field_name(cls):
+ try:
+ return cls.EMAIL_FIELD
+ except AttributeError:
+ return 'email'
+
+ @classmethod
def normalize_username(cls, username):
return unicodedata.normalize('NFKC', force_text(username))