def _create_user(self, email, password, **extra_fields):  # type: ignore[no-untyped-def]
        """Create and save a User with the given email and password."""
        if not email:
            raise ValueError("The given email must be set")
        email = self.normalize_email(email)
        user = self.model(email=email, **extra_fields)
        user.set_password(password)
        user.save(using=self._db)
        return user
Create and save a User with the given email and password.
api/users/models.py