Skip to content

Commit b10ce22

Browse files
committed
fix: Update tool_type assignment in ToolSerializer to use tool_data value
1 parent cec3381 commit b10ce22

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
@@ -797,6 +797,7 @@ def add(self, instance: Dict, with_valid=True):
797797
res = requests.get(download_url, timeout=5)
798798
tool_data = RestrictedUnpickler(io.BytesIO(res.content)).load().tool
799799
tool_id = uuid.uuid7()
800+
print(instance.get('tool_type'))
800801
tool = Tool(
801802
id=tool_id,
802803
name=instance.get('name'),
@@ -808,7 +809,7 @@ def add(self, instance: Dict, with_valid=True):
808809
input_field_list=tool_data.get('input_field_list', []),
809810
init_field_list=tool_data.get('init_field_list', []),
810811
scope=ToolScope.WORKSPACE,
811-
tool_type=instance.get('tool_type', ToolType.CUSTOM),
812+
tool_type=tool_data.get('tool_type', ToolType.CUSTOM),
812813
folder_id=instance.get('folder_id', self.data.get('workspace_id')),
813814
template_id=self.data.get('tool_id'),
814815
label=instance.get('label'),

0 commit comments

Comments
 (0)