diff --git a/capella2polarion/__main__.py b/capella2polarion/__main__.py index 097ade32..17e45fba 100644 --- a/capella2polarion/__main__.py +++ b/capella2polarion/__main__.py @@ -232,14 +232,12 @@ def model_elements( ctx.obj["ELEMENTS"]["Diagram"] = [ diag for diag in ctx.obj["ELEMENTS"]["Diagram"] if diag.uuid in duuids ] - work_items = elements.element.create_work_items(ctx.obj) - ctx.obj["WORK_ITEMS"] = {wi.uuid_capella: wi for wi in work_items} + elements.element.create_work_items(ctx.obj) elements.delete_work_items(ctx.obj) elements.post_work_items(ctx.obj) - work_items = elements.element.create_work_items(ctx.obj) - ctx.obj["WORK_ITEMS"] = {wi.uuid_capella: wi for wi in work_items} + elements.element.create_work_items(ctx.obj) elements.patch_work_items(ctx.obj) elements.make_model_elements_index(ctx.obj) diff --git a/capella2polarion/elements/element.py b/capella2polarion/elements/element.py index 84ae08d5..c64ef780 100644 --- a/capella2polarion/elements/element.py +++ b/capella2polarion/elements/element.py @@ -59,6 +59,7 @@ def create_work_items( "%r are missing in the capella2polarion configuration", ", ".join(missing_types), ) + ctx["WORK_ITEMS"] = {wi.uuid_capella: wi for wi in work_items} return work_items @@ -212,8 +213,8 @@ def _handle_exchanges( list[polarion_api.WorkItemLink], ] CUSTOM_LINKS: dict[str, CustomLinkMaker] = { - "description_reference": _handle_description_reference_links, # type: ignore[dict-item] - "diagram_elements": _handle_diagram_reference_links, # type: ignore[dict-item] + "description_reference": _handle_description_reference_links, + "diagram_elements": _handle_diagram_reference_links, "input_exchanges": functools.partial(_handle_exchanges, attr="inputs"), "output_exchanges": functools.partial(_handle_exchanges, attr="outputs"), }