updates
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -21,8 +21,10 @@ class RegisterRequest(BaseModel):
|
||||
|
||||
@validator('phone')
|
||||
def validate_phone(cls, v):
|
||||
if v and (not v.isdigit()) or (v and len(v) not in [10, 11]):
|
||||
raise ValueError('Phone must be 10-11 digits')
|
||||
if v:
|
||||
cleaned = ''.join(c for c in v if c.isdigit())
|
||||
if len(cleaned) < 5:
|
||||
raise ValueError('Phone number must contain at least 5 digits')
|
||||
return v
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user