feat: phone auth tests and fixes
This commit is contained in:
@@ -17,8 +17,8 @@ class UserRole(models.TextChoices):
|
||||
class UserManager(BaseUserManager):
|
||||
def create_user(self, email=None, password=None, **extra_fields):
|
||||
phone_number = extra_fields.get("phone_number")
|
||||
if not email and not phone_number:
|
||||
raise ValueError("Email or phone number is required")
|
||||
if not phone_number:
|
||||
raise ValueError("Phone number is required")
|
||||
if email:
|
||||
email = self.normalize_email(email)
|
||||
user = self.model(email=email, **extra_fields)
|
||||
|
||||
Reference in New Issue
Block a user