Remove deprecated display_name field from user registration methods
This commit is contained in:
parent
4227f86ffc
commit
3313a47c72
1 changed files with 6 additions and 6 deletions
|
@ -12,8 +12,8 @@ from .helpers import profile_to_coords, upload_path
|
||||||
class UserManager(BaseUserManager):
|
class UserManager(BaseUserManager):
|
||||||
use_in_migrations = True
|
use_in_migrations = True
|
||||||
|
|
||||||
def _create_user(self, email, display_name, password, **extra_fields):
|
def _create_user(self, email, password, **extra_fields):
|
||||||
values = [email, display_name]
|
values = [email]
|
||||||
field_value_map = dict(zip(self.model.REQUIRED_FIELDS, values))
|
field_value_map = dict(zip(self.model.REQUIRED_FIELDS, values))
|
||||||
for field_name, value in field_value_map.items():
|
for field_name, value in field_value_map.items():
|
||||||
if not value:
|
if not value:
|
||||||
|
@ -29,12 +29,12 @@ class UserManager(BaseUserManager):
|
||||||
user.save(using=self._db)
|
user.save(using=self._db)
|
||||||
return user
|
return user
|
||||||
|
|
||||||
def create_user(self, email, display_name, password=None, **extra_fields):
|
def create_user(self, email, password=None, **extra_fields):
|
||||||
return self._create_user(email, display_name, password, **extra_fields)
|
return self._create_user(email, password, **extra_fields)
|
||||||
|
|
||||||
def create_superuser(self, email, display_name, password=None, **extra_fields):
|
def create_superuser(self, email, password=None, **extra_fields):
|
||||||
extra_fields.setdefault('is_superuser', True)
|
extra_fields.setdefault('is_superuser', True)
|
||||||
return self._create_user(email, display_name, password, **extra_fields)
|
return self._create_user(email, password, **extra_fields)
|
||||||
|
|
||||||
class User(AbstractBaseUser):
|
class User(AbstractBaseUser):
|
||||||
email = models.EmailField(unique=True)
|
email = models.EmailField(unique=True)
|
||||||
|
|
Loading…
Reference in a new issue