This commit is contained in:
parent
a6e24a49be
commit
5f234a54f1
@ -17,7 +17,7 @@ class MyUserManager(BaseUserManager):
|
|||||||
def create_superuser(self, email, password=None, **extra_fields):
|
def create_superuser(self, email, password=None, **extra_fields):
|
||||||
extra_fields.setdefault('is_staff', True)
|
extra_fields.setdefault('is_staff', True)
|
||||||
extra_fields.setdefault('is_superuser', True)
|
extra_fields.setdefault('is_superuser', True)
|
||||||
|
email = self.normalize_email(email)
|
||||||
if extra_fields.get('is_staff') is not True:
|
if extra_fields.get('is_staff') is not True:
|
||||||
raise ValueError(_('Superuser must have is_staff=True.'))
|
raise ValueError(_('Superuser must have is_staff=True.'))
|
||||||
if extra_fields.get('is_superuser') is not True:
|
if extra_fields.get('is_superuser') is not True:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user