From fd38b300dfe050687a5ba2c61d2d0ef8d4a9a224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Mon, 2 Mar 2026 14:26:46 +0800 Subject: [PATCH] Update api/controllers/service_api/app/workflow_events.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../service_api/app/workflow_events.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/api/controllers/service_api/app/workflow_events.py b/api/controllers/service_api/app/workflow_events.py index b610623bfa..308d7e7c40 100644 --- a/api/controllers/service_api/app/workflow_events.py +++ b/api/controllers/service_api/app/workflow_events.py @@ -58,14 +58,13 @@ class WorkflowEventsApi(Resource): run_id=task_id, ) - if workflow_run is None: - raise NotFound(f"WorkflowRun not found, id={task_id}") - if workflow_run.app_id != app_model.id: - raise NotFound(f"WorkflowRun not found, id={task_id}") - if workflow_run.created_by_role != CreatorUserRole.END_USER: - raise NotFound(f"WorkflowRun not created by end user, id={task_id}") - if workflow_run.created_by != end_user.id: - raise NotFound(f"WorkflowRun not created by the current end user, id={task_id}") + if ( + workflow_run is None + or workflow_run.app_id != app_model.id + or workflow_run.created_by_role != CreatorUserRole.END_USER + or workflow_run.created_by != end_user.id + ): + raise NotFound("Workflow run not found") if workflow_run.finished_at is not None: response = WorkflowResponseConverter.workflow_run_result_to_finish_response(