diff --git a/localauth/models.py b/localauth/models.py index 8d4daa6..28fe5a3 100644 --- a/localauth/models.py +++ b/localauth/models.py @@ -12,8 +12,8 @@ from .helpers import profile_to_coords, upload_path class UserManager(BaseUserManager): use_in_migrations = True - def _create_user(self, email, display_name, password, **extra_fields): - values = [email, display_name] + def _create_user(self, email, password, **extra_fields): + values = [email] field_value_map = dict(zip(self.model.REQUIRED_FIELDS, values)) for field_name, value in field_value_map.items(): if not value: @@ -29,12 +29,12 @@ class UserManager(BaseUserManager): user.save(using=self._db) return user - def create_user(self, email, display_name, password=None, **extra_fields): - return self._create_user(email, display_name, password, **extra_fields) + def create_user(self, email, password=None, **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) - return self._create_user(email, display_name, password, **extra_fields) + return self._create_user(email, password, **extra_fields) class User(AbstractBaseUser): email = models.EmailField(unique=True)