1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

переработка модальных окон4

This commit is contained in:
MoonTestUse1
2025-01-03 02:47:56 +06:00
parent 50631b8c30
commit 725c120b19
4 changed files with 373 additions and 1 deletions

View File

@@ -63,6 +63,11 @@ def update_employee(
# Обновляем данные
update_data = employee_update.model_dump(exclude_unset=True)
# Если передан пароль, хешируем его
if 'password' in update_data:
update_data['password'] = pwd_context.hash(update_data['password'])
for field, value in update_data.items():
setattr(db_employee, field, value)

View File

@@ -17,6 +17,7 @@ class EmployeeUpdate(BaseModel):
last_name: str | None = None
department: str | None = None
office: str | None = None
password: str | None = None
model_config = ConfigDict(from_attributes=True)