From b55371345af44503e8a222a004c2a5cf07f4c94f Mon Sep 17 00:00:00 2001 From: ewuerger Date: Tue, 18 Jun 2024 06:35:15 +0200 Subject: [PATCH] fix(context): Handle cycles in `move_edges` 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: