fix: cannot delete workflow version if other version is published as a tool (#18486)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- authored and GitHub committed 2025-04-21 17:58:22 +08:00
1 parent 3136eb8e4b
commit 2543162dec
3 files changed
+31 -3

No files matched your search

+7
View File
@@ -245,6 +245,13 @@ class Workflow(Base):
@property
def tool_published(self) -> bool:
"""
DEPRECATED: This property is not accurate for determining if a workflow is published as a tool.
It only checks if there's a WorkflowToolProvider for the app, not if this specific workflow version
is the one being used by the tool.
For accurate checking, use a direct query with tenant_id, app_id, and version.
"""
from models.tools import WorkflowToolProvider
return (