[FWA-3] fix cannot hash password

This commit is contained in:
2024-06-11 12:55:46 +00:00
parent 3fed0650c9
commit db091176da
3 changed files with 11 additions and 7 deletions

View File

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