AURORA-1247: исполнитель может получать этапы

This commit is contained in:
tsygankoviva 2026-08-13 14:52:00 +03:00
parent 29973f97e9
commit d8bf4e7bde
2 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ async def get_form_phases(
) )
if phases: if phases:
form = await bf_service.get(user=current_user, budget_form_id=form_id) form = await bf_service.get(user=current_user, budget_form_id=form_id)
org_unit = await org_unit_service.get(user=current_user, org_unit_id=form.org_unit_id) org_unit = await org_unit_service.get(org_unit_id=form.org_unit_id)
result = [FormPhaseResponse.model_validate(p) for p in phases] result = [FormPhaseResponse.model_validate(p) for p in phases]
if org_unit.utc_offset: if org_unit.utc_offset:
tz = timezone_from_offset(org_unit.utc_offset) tz = timezone_from_offset(org_unit.utc_offset)

View File

@ -40,10 +40,10 @@ class OrgUnitService:
async def get( async def get(
self, self,
org_unit_id: int, org_unit_id: int,
user: AppUser, user: AppUser | None = None,
load_users: bool = False, load_users: bool = False,
) -> OrgUnit | None: ) -> OrgUnit | None:
if user.role_id != UserRoleEnum.ADMIN: if user and user.role_id != UserRoleEnum.ADMIN:
return None return None
return await self.org_repo.get( return await self.org_repo.get(
org_unit_id=org_unit_id, org_unit_id=org_unit_id,