Merge pull request 'change-role-fix: обновленное значение ссп при смене роли' (#32) from change-role-fix into test

Reviewed-on: #32
Reviewed-by: Raykov-MS <RaykovMS@avt.rshb.ru>
This commit is contained in:
tsygankoviva 2026-06-04 16:05:17 +03:00
commit ed31f6b519
2 changed files with 2 additions and 1 deletions

View File

@ -167,7 +167,7 @@ class UserRepository:
),
{"user_id": user_id, "org_unit_ids": org_unit_ids},
)
await self.db.commit()
await self.db.flush()
async def create(self, user_data: dict) -> AppUser:
hashed_password = (

View File

@ -112,6 +112,7 @@ class UserService:
if (had_many_ssp_role and not has_many_ssp_role_now) or is_executor_to_dfip_transition:
await self.user_repo.clear_many_ssp(user_id)
if user_data.load_orgs:
self.db.expire(updated)
updated = await self.user_repo.get(
user_id=user_id,
load_orgs=user_data.load_orgs,