From 7bca86470922ecf39ca5d983aa97fa0997b7d173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernst=20W=C3=BCrger?= <50786483+ewuerger@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:59:57 +0200 Subject: [PATCH] fix: Apply suggestions from code review Co-authored-by: micha91 --- capella2polarion/elements/__init__.py | 9 +++------ capella2polarion/elements/serialize.py | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/capella2polarion/elements/__init__.py b/capella2polarion/elements/__init__.py index c08f97ff..48f53103 100644 --- a/capella2polarion/elements/__init__.py +++ b/capella2polarion/elements/__init__.py @@ -103,12 +103,9 @@ def post_work_items(ctx: dict[str, t.Any]) -> None: ctx The context for the workitem operation to be processed. """ - work_items = [ - wi - for wi in ctx["WORK_ITEMS"].values() - if wi.uuid_capella not in ctx["POLARION_ID_MAP"] - ] - for work_item in work_items: + for work_item in ctx["WORK_ITEMS"].values(): + if wi.uuid_capella in ctx["POLARION_ID_MAP"]: + continue assert work_item is not None logger.info("Create work item for %r...", work_item.title) if work_items: diff --git a/capella2polarion/elements/serialize.py b/capella2polarion/elements/serialize.py index 3a50d308..674c3670 100644 --- a/capella2polarion/elements/serialize.py +++ b/capella2polarion/elements/serialize.py @@ -48,7 +48,6 @@ class Condition(t.TypedDict): uuid_capella: str | None preCondition: Condition | None postCondition: Condition | None - checksum: str | None def element(