| 37 | |
| 38 | |
| 39 | class UserBase(MongoBaseModel): |
| 40 | |
| 41 | username: str = Field(..., min_length=3, max_length=15) |
| 42 | email: str = Field(...) |
| 43 | password: str = Field(...) |
| 44 | role: Role |
| 45 | |
| 46 | @validator("email") |
| 47 | def valid_email(cls, v): |
| 48 | |
| 49 | try: |
| 50 | email = validate_email(v).email |
| 51 | return email |
| 52 | except EmailNotValidError as e: |
| 53 | |
| 54 | raise EmailNotValidError |
| 55 | |
| 56 | |
| 57 | class LoginBase(BaseModel): |
nothing calls this directly
no outgoing calls
no test coverage detected