fix: published workflow(tool) can be deleted. (#17900)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2025-04-11 20:39:09 +09:00
committed by GitHub
parent 59b2e1ab82
commit 08a693a0a0
2 changed files with 122 additions and 0 deletions

View File

@@ -515,5 +515,10 @@ class WorkflowService:
# Cannot delete a workflow that's currently in use by an app
raise WorkflowInUseError(f"Cannot delete workflow that is currently in use by app '{app.name}'")
# Check if this workflow is published as a tool
if workflow.tool_published:
# Cannot delete a workflow that's published as a tool
raise WorkflowInUseError("Cannot delete workflow that is published as a tool")
session.delete(workflow)
return True