add User return schema
This commit is contained in:
@@ -6,11 +6,12 @@ from src.schemas.validators import ensure_password
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
id: int
|
||||
email: EmailStr | None
|
||||
username: str
|
||||
is_active: bool
|
||||
is_superuser: bool
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||
|
||||
|
||||
class UserWithHashedPass(User):
|
||||
@@ -21,3 +22,11 @@ class UserRequest(BaseModel):
|
||||
username: str
|
||||
email: EmailStr | None = None
|
||||
password: Annotated[str, BeforeValidator(ensure_password)]
|
||||
|
||||
|
||||
class UserAdd(BaseModel):
|
||||
email: EmailStr | None
|
||||
username: str
|
||||
is_active: bool
|
||||
is_superuser: bool
|
||||
hashed_password: str
|
||||
|
||||
Reference in New Issue
Block a user