Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1232 from fusionbox/normalize_email

Fixed #20531 -- Don't hard-code class names when calling static methods
  • Loading branch information...
commit 3d883e8bd96df8f2166aec6331b80781463539a6 2 parents 728d3fe + 01ae881
@claudep claudep authored
View
2  django/contrib/auth/models.py
@@ -177,7 +177,7 @@ def create_user(self, username, email=None, password=None, **extra_fields):
now = timezone.now()
if not username:
raise ValueError('The given username must be set')
- email = UserManager.normalize_email(email)
+ email = self.normalize_email(email)
user = self.model(username=username, email=email,
is_staff=False, is_active=True, is_superuser=False,
last_login=now, date_joined=now, **extra_fields)
View
2  django/contrib/auth/tests/test_custom_user.py
@@ -21,7 +21,7 @@ def create_user(self, email, date_of_birth, password=None):
raise ValueError('Users must have an email address')
user = self.model(
- email=CustomUserManager.normalize_email(email),
+ email=self.normalize_email(email),
date_of_birth=date_of_birth,
)
View
2  docs/topics/auth/customizing.txt
@@ -939,7 +939,7 @@ authentication app::
raise ValueError('Users must have an email address')
user = self.model(
- email=MyUserManager.normalize_email(email),
+ email=self.normalize_email(email),
date_of_birth=date_of_birth,
)
Please sign in to comment.
Something went wrong with that request. Please try again.