fix: Shared workspace permission control error (#3548)

This commit is contained in:
shaohuzhang1 2025-07-10 16:45:13 +08:00 committed by GitHub
parent 4d87e01682
commit 4f4565f85b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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):