1
0
mirror of https://github.com/django/django.git synced 2025-03-31 11:37:06 +00:00

Merge pull request from fusionbox/normalize_email

Fixed  -- Don't hard-code class names when calling static methods
This commit is contained in:
Claude Paroz 2013-05-31 00:56:56 -07:00
commit 3d883e8bd9
3 changed files with 3 additions and 3 deletions
django/contrib/auth
docs/topics/auth

@ -177,7 +177,7 @@ class UserManager(BaseUserManager):
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)

@ -21,7 +21,7 @@ class CustomUserManager(BaseUserManager):
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,
)

@ -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,
)