From 136fadfb3b9c58da28a17b92d761502355ee75a9 Mon Sep 17 00:00:00 2001 From: ewuerger Date: Tue, 12 Dec 2023 14:24:57 +0100 Subject: [PATCH] refactor: Apply requested change from review to `patch_work_items` --- capella2polarion/elements/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/capella2polarion/elements/__init__.py b/capella2polarion/elements/__init__.py index a98126c9..ba119130 100644 --- a/capella2polarion/elements/__init__.py +++ b/capella2polarion/elements/__init__.py @@ -148,9 +148,7 @@ def patch_work_items(ctx: dict[str, t.Any]) -> None: objects = ctx["MODEL"].diagrams obj = objects.by_uuid(uuid) - work_item: serialize.CapellaWorkItem - if (work_item := ctx["WORK_ITEMS"][uuid]) is None: - continue + work_item: serialize.CapellaWorkItem = ctx["WORK_ITEMS"][uuid] old_work_item: serialize.CapellaWorkItem = ctx["POLARION_WI_MAP"][uuid] links = element.create_links(obj, ctx) @@ -161,8 +159,6 @@ def patch_work_items(ctx: dict[str, t.Any]) -> None: for uuid in uuids: new_work_item: serialize.CapellaWorkItem = ctx["WORK_ITEMS"][uuid] - if (new_work_item := ctx["WORK_ITEMS"][uuid]) is None: - continue old_work_item = ctx["POLARION_WI_MAP"][uuid] if old_work_item.id in back_links: element.create_grouped_back_link_fields(