fix: 调API创建与父节点同名的子节点报错:同级别节点名称不能重复 (#11858)

Co-authored-by: feng <1304903146@qq.com>
pull/11859/head
fit2bot 1 year ago committed by GitHub
parent 8b6526211c
commit bda23b3d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,8 +30,9 @@ class NodeSerializer(BulkOrgResourceModelSerializer):
if '/' in data: if '/' in data:
error = _("Can't contains: " + "/") error = _("Can't contains: " + "/")
raise serializers.ValidationError(error) raise serializers.ValidationError(error)
if self.instance: view = self.context['view']
instance = self.instance instance = self.instance or getattr(view, 'instance', None)
if instance:
siblings = instance.get_siblings() siblings = instance.get_siblings()
else: else:
instance = Node.org_root() instance = Node.org_root()

Loading…
Cancel
Save