From 4f4565f85b99ff2799d478a93828e856953755c7 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 10 Jul 2025 16:45:13 +0800 Subject: [PATCH] fix: Shared workspace permission control error (#3548) --- apps/tools/serializers/tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tools/serializers/tool.py b/apps/tools/serializers/tool.py index 6f6bcf898..4275ef0c5 100644 --- a/apps/tools/serializers/tool.py +++ b/apps/tools/serializers/tool.py @@ -296,7 +296,8 @@ class ToolSerializer(serializers.Serializer): if not query_set.exists(): get_authorized_tool = DatabaseModelManage.get_model('get_authorized_tool') if get_authorized_tool: - return get_authorized_tool(QuerySet(Tool).filter(id=self.data.get('id')), workspace_id).exists() + if not get_authorized_tool(QuerySet(Tool).filter(id=self.data.get('id')), workspace_id).exists(): + raise AppApiException(500, _('Tool id does not exist')) raise AppApiException(500, _('Tool id does not exist')) def is_valid(self, *, raise_exception=False):