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>
This commit is contained in:
非法操作
2026-03-02 14:26:46 +08:00
committed by Blackoutta
parent 60f5c31389
commit 1b035a9561

View File

@ -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(