mirror of
https://github.com/langgenius/dify.git
synced 2026-04-20 18:57:19 +08:00
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:
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user