From 03d82855c2b51ec9af179449d73590546db0bcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernst=20W=C3=BCrger?= Date: Tue, 18 Jun 2024 12:21:00 +0200 Subject: [PATCH] fix(context): Handle cycles in `move_edges` (#108) Common UUID was detected as the target and source itself. This commit fixes it by just removing this UUID from both sets. --- capellambse_context_diagrams/collectors/generic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/capellambse_context_diagrams/collectors/generic.py b/capellambse_context_diagrams/collectors/generic.py index 7ca84d59..4e935d64 100644 --- a/capellambse_context_diagrams/collectors/generic.py +++ b/capellambse_context_diagrams/collectors/generic.py @@ -230,6 +230,10 @@ def move_edges( for c in connections: source_owner_uuids = get_all_owners(c.source) target_owner_uuids = get_all_owners(c.target) + if c.source == c.target: + source_owner_uuids.remove(c.source.uuid) + target_owner_uuids.remove(c.source.uuid) + common_owner_uuid = None for owner in source_owner_uuids: if owner in target_owner_uuids: