mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-10 18:10:58 +00:00
Fix CustomUserManager._create_user to allow passing is_active=False
This commit is contained in:
parent
097f45f20b
commit
3e5c665014
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ from django.contrib.auth.models import (
|
|||
|
||||
class CustomUserManager(BaseUserManager):
|
||||
def _create_user(self, username, email, password,
|
||||
is_staff, is_superuser, **extra_fields):
|
||||
is_staff, is_superuser, is_active=True, **extra_fields):
|
||||
"""
|
||||
Creates and saves a User with the given username, email and password.
|
||||
"""
|
||||
|
|
@ -16,7 +16,7 @@ class CustomUserManager(BaseUserManager):
|
|||
raise ValueError('The given username must be set')
|
||||
email = self.normalize_email(email)
|
||||
user = self.model(username=username, email=email,
|
||||
is_staff=is_staff, is_active=True,
|
||||
is_staff=is_staff, is_active=is_active,
|
||||
is_superuser=is_superuser, **extra_fields)
|
||||
user.set_password(password)
|
||||
user.save(using=self._db)
|
||||
|
|
|
|||
Loading…
Reference in a new issue