[FWA-3] fix cannot hash password
This commit is contained in:
@ -3,6 +3,7 @@ from uuid import UUID
|
||||
from pydantic import ConfigDict
|
||||
from fastapi import Form
|
||||
|
||||
from backend.core.security.security import hash_password
|
||||
from backend.schemas.main_model import MainModel
|
||||
|
||||
class UserBase(MainModel):
|
||||
@ -21,6 +22,9 @@ class UserProfile(MainModel):
|
||||
is_lock: bool | None = None
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
def update_password(self):
|
||||
self.password = (None if self.password is None else hash_password(self.password))
|
||||
|
||||
class UserSeeds(UserCreate):
|
||||
is_admin: bool
|
||||
is_lock: bool
|
||||
|
Reference in New Issue
Block a user