From ee83f74fb9cad158b0477eb8fc2998980e8c076c Mon Sep 17 00:00:00 2001 From: dv Date: Thu, 9 Apr 2026 14:26:39 +0300 Subject: [PATCH] =?UTF-8?q?ssh=20=D1=84=D0=B8=D0=BA=D1=81=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/services/task.py b/backend/app/services/task.py index 6a5884a..c7847f9 100644 --- a/backend/app/services/task.py +++ b/backend/app/services/task.py @@ -44,7 +44,10 @@ async def _emit(task_id: str, message: str, level: str = "info") -> None: async def _resolve_scope(scope: dict) -> list[tuple[Device, Object]]: """Expand target_scope to a list of (device, parent_object) pairs.""" async with AsyncSessionLocal() as db: - query = select(Device).options(selectinload(Device.object)).where(Device.is_active == True) + query = select(Device).options( + selectinload(Device.object).selectinload(Object.ssh_credentials), + selectinload(Device.object).selectinload(Object.category_credentials), + ).where(Device.is_active == True) scope_type = scope.get("type") if scope_type == "device":