From d8bf4e7bded260b72d5c3601dd195b867e79ec9c Mon Sep 17 00:00:00 2001 From: tsygankoviva Date: Thu, 13 Aug 2026 14:52:00 +0300 Subject: [PATCH] =?UTF-8?q?AURORA-1247:=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=20=D0=BC=D0=BE=D0=B6=D0=B5?= =?UTF-8?q?=D1=82=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D1=8D=D1=82=D0=B0=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/api/v1/form_phases.py | 2 +- api/src/services/org_unit_service.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/api/v1/form_phases.py b/api/src/api/v1/form_phases.py index 82f8837..0ca725f 100644 --- a/api/src/api/v1/form_phases.py +++ b/api/src/api/v1/form_phases.py @@ -63,7 +63,7 @@ async def get_form_phases( ) if phases: 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] if org_unit.utc_offset: tz = timezone_from_offset(org_unit.utc_offset) diff --git a/api/src/services/org_unit_service.py b/api/src/services/org_unit_service.py index 1313192..cc7b498 100644 --- a/api/src/services/org_unit_service.py +++ b/api/src/services/org_unit_service.py @@ -40,10 +40,10 @@ class OrgUnitService: async def get( self, org_unit_id: int, - user: AppUser, + user: AppUser | None = None, load_users: bool = False, ) -> OrgUnit | None: - if user.role_id != UserRoleEnum.ADMIN: + if user and user.role_id != UserRoleEnum.ADMIN: return None return await self.org_repo.get( org_unit_id=org_unit_id,