From 393e113af69d8e3b9fe81780eca184fc3bfe2fb4 Mon Sep 17 00:00:00 2001 From: Michael Harbarth Date: Tue, 29 Oct 2024 17:09:19 +0100 Subject: [PATCH] fix: Don't delete workitems again and again --- capella2polarion/connectors/polarion_worker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/capella2polarion/connectors/polarion_worker.py b/capella2polarion/connectors/polarion_worker.py index 1183b06..cbf5e7f 100644 --- a/capella2polarion/connectors/polarion_worker.py +++ b/capella2polarion/connectors/polarion_worker.py @@ -146,11 +146,12 @@ def delete_orphaned_work_items( ): logger.info("Delete work item %r...", wi.id) work_items.append(wi) - try: - self.project_client.work_items.delete(work_items) - except polarion_api.PolarionApiException as error: - logger.error("Deleting work items failed. %s", error.args[0]) - raise error + + try: + self.project_client.work_items.delete(work_items) + 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)