From 5c166b3f409f6e56b45aeffc7b058278de21e793 Mon Sep 17 00:00:00 2001 From: zhaobingshuang <1475195565@qq.com> Date: Mon, 9 Dec 2024 14:38:02 +0800 Subject: [PATCH] fix: tags could not be saved when the Workflow Tool was created (#11481) Co-authored-by: zhaobs --- api/controllers/console/workspace/tool_providers.py | 1 + api/services/tools/workflow_tools_manage_service.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/api/controllers/console/workspace/tool_providers.py b/api/controllers/console/workspace/tool_providers.py index 9ecda2126d4b42..2cd6dcda3b5ea7 100644 --- a/api/controllers/console/workspace/tool_providers.py +++ b/api/controllers/console/workspace/tool_providers.py @@ -368,6 +368,7 @@ def post(self): description=args["description"], parameters=args["parameters"], privacy_policy=args["privacy_policy"], + labels=args["labels"], ) diff --git a/api/services/tools/workflow_tools_manage_service.py b/api/services/tools/workflow_tools_manage_service.py index 833881b668b383..318107bebb5eb6 100644 --- a/api/services/tools/workflow_tools_manage_service.py +++ b/api/services/tools/workflow_tools_manage_service.py @@ -81,6 +81,10 @@ def create_workflow_tool( db.session.add(workflow_tool_provider) db.session.commit() + if labels is not None: + ToolLabelManager.update_tool_labels( + ToolTransformService.workflow_provider_to_controller(workflow_tool_provider), labels + ) return {"result": "success"} @classmethod