Create and save a User with the given email and password.
(self, email, password, **extra_fields)
| 77 | use_in_migrations = True |
| 78 | |
| 79 | def _create_user(self, email, password, **extra_fields): # type: ignore[no-untyped-def] |
| 80 | """Create and save a User with the given email and password.""" |
| 81 | if not email: |
| 82 | raise ValueError("The given email must be set") |
| 83 | email = self.normalize_email(email) |
| 84 | user = self.model(email=email, **extra_fields) |
| 85 | user.set_password(password) |
| 86 | user.save(using=self._db) |
| 87 | return user |
| 88 | |
| 89 | def create_user(self, email, password=None, **extra_fields): # type: ignore[no-untyped-def] |
| 90 | """Create and save a regular User with the given email and password.""" |
no test coverage detected