This commit is contained in:
Iliyan Angelov
2025-11-21 19:44:42 +02:00
parent 2a105c1170
commit 9842cc3a4a
24 changed files with 2801 additions and 2654 deletions

View File

@@ -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):