Commit 7ff63918 authored by BaiJiangJie's avatar BaiJiangJie

[Update] 修改删除节点 API 返回的状态码

parent 5f96f8c2
......@@ -62,11 +62,8 @@ class NodeViewSet(OrgModelViewSet):
def destroy(self, request, *args, **kwargs):
node = self.get_object()
if node.has_children_or_contains_assets():
msg = _("Deletion failed "
"and the node contains children or assets")
return Response(
data={'msg': msg}, status=status.HTTP_500_INTERNAL_SERVER_ERROR
)
msg = _("Deletion failed and the node contains children or assets")
return Response(data={'msg': msg}, status=status.HTTP_403_FORBIDDEN)
return super().destroy(request, *args, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment