Skip to content

Commit afd0743

Browse files
committed
fix: [Tool] After importing the workflow tool, it should be in an inactive state
1 parent 243684b commit afd0743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/tools/serializers/tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ def to_tool(tool, workspace_id, user_id, folder_id):
788788
template_id=tool.get('template_id'),
789789
input_field_list=tool.get('input_field_list'),
790790
init_field_list=tool.get('init_field_list'),
791-
is_active=False if len((tool.get('init_field_list') or [])) > 0 else tool.get('is_active'),
791+
is_active=False if (len((tool.get('init_field_list') or [])) > 0 or tool.get(
792+
'tool_type') == ToolType.WORKFLOW) else tool.get('is_active'),
792793
tool_type=tool.get('tool_type', 'CUSTOM') or 'CUSTOM',
793794
scope=ToolScope.SHARED if workspace_id == 'None' else ToolScope.WORKSPACE,
794795
folder_id=folder_id if folder_id else 'default' if workspace_id == 'None' else workspace_id,

0 commit comments

Comments
 (0)