diff --git a/backend/app/routers/tasks.py b/backend/app/routers/tasks.py index c0f5874..bba75b3 100644 --- a/backend/app/routers/tasks.py +++ b/backend/app/routers/tasks.py @@ -70,9 +70,11 @@ async def _resolve_labels(db: AsyncSession, tasks: list[Task]) -> dict[str, str] elif kind == "device": labels[t.id] = devs.get(scope.get("id"), f"Устройство #{scope.get('id')}") elif kind == "rack": - labels[t.id] = f"Стойка: {rack_names.get(scope.get('id'), f'#{scope.get(\"id\")}')}" + _rid = scope.get('id') + labels[t.id] = f"Стойка: {rack_names.get(_rid, f'#{_rid}')}" elif kind == "zone": - labels[t.id] = f"Зона: {zone_names.get(scope.get('id'), f'#{scope.get(\"id\")}')}" + _zid = scope.get('id') + labels[t.id] = f"Зона: {zone_names.get(_zid, f'#{_zid}')}" elif kind in ("category", "role"): val = scope.get("value", "?") if oid := scope.get("object_id"):