From fc5c44c915ebc368ddfeb2ab6ca5c99810c61c5c Mon Sep 17 00:00:00 2001 From: Sebastiaan la Fleur Date: Wed, 17 Apr 2024 14:54:32 +0200 Subject: [PATCH] 16: Fix typing issue. --- src/omotes_rest/rest_interface.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/omotes_rest/rest_interface.py b/src/omotes_rest/rest_interface.py index 954e98f..0c3bc59 100644 --- a/src/omotes_rest/rest_interface.py +++ b/src/omotes_rest/rest_interface.py @@ -163,13 +163,13 @@ def cancel_job(self, job_id: uuid.UUID) -> bool: """ job_in_db = self.get_job(job_id) - workflow_type = self.workflow_type_manager.get_workflow_by_name( - FRONTEND_NAME_TO_OMOTES_WORKFLOW_NAME[job_in_db.workflow_type] - ) - if not workflow_type: - raise RuntimeError(f"Unknown workflow type {job_in_db.workflow_type}") - if job_in_db: + workflow_type = self.workflow_type_manager.get_workflow_by_name( + FRONTEND_NAME_TO_OMOTES_WORKFLOW_NAME[job_in_db.workflow_type] + ) + if not workflow_type: + raise RuntimeError(f"Unknown workflow type {job_in_db.workflow_type}") + job = Job(id=job_id, workflow_type=workflow_type) self.omotes_if.cancel_job(job) result = True