This commit is contained in:
dv 2026-04-07 17:40:17 +03:00
parent ff7569d4ad
commit 2aabfdc8b4

View file

@ -70,9 +70,11 @@ async def _resolve_labels(db: AsyncSession, tasks: list[Task]) -> dict[str, str]
elif kind == "device": elif kind == "device":
labels[t.id] = devs.get(scope.get("id"), f"Устройство #{scope.get('id')}") labels[t.id] = devs.get(scope.get("id"), f"Устройство #{scope.get('id')}")
elif kind == "rack": 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": 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"): elif kind in ("category", "role"):
val = scope.get("value", "?") val = scope.get("value", "?")
if oid := scope.get("object_id"): if oid := scope.get("object_id"):