From 6abc00a2e75ce6fefab200b7f87854e6dae6b0bc Mon Sep 17 00:00:00 2001 From: Michael Harbarth Date: Wed, 4 Sep 2024 12:28:22 +0200 Subject: [PATCH] fix: we should only delete the work_items once from the mapping, otherwise all runs with more than one work item to be deleted will fail --- capella2polarion/connectors/polarion_worker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/capella2polarion/connectors/polarion_worker.py b/capella2polarion/connectors/polarion_worker.py index dd84dfb..e6b2237 100644 --- a/capella2polarion/connectors/polarion_worker.py +++ b/capella2polarion/connectors/polarion_worker.py @@ -152,13 +152,12 @@ def delete_orphaned_work_items( work_items.append(wi) try: self.project_client.work_items.delete(work_items) - self.polarion_data_repo.remove_work_items_by_capella_uuid( - uuids - ) except polarion_api.PolarionApiException as error: logger.error("Deleting work items failed. %s", error.args[0]) raise error + self.polarion_data_repo.remove_work_items_by_capella_uuid(uuids) + def create_missing_work_items( self, converter_session: data_session.ConverterSession ) -> None: