mirror of https://github.com/jumpserver/jumpserver
fix: 调API创建与父节点同名的子节点报错:同级别节点名称不能重复 (#11858)
Co-authored-by: feng <1304903146@qq.com>pull/11859/head
parent
8b6526211c
commit
bda23b3d2a
|
@ -30,8 +30,9 @@ class NodeSerializer(BulkOrgResourceModelSerializer):
|
|||
if '/' in data:
|
||||
error = _("Can't contains: " + "/")
|
||||
raise serializers.ValidationError(error)
|
||||
if self.instance:
|
||||
instance = self.instance
|
||||
view = self.context['view']
|
||||
instance = self.instance or getattr(view, 'instance', None)
|
||||
if instance:
|
||||
siblings = instance.get_siblings()
|
||||
else:
|
||||
instance = Node.org_root()
|
||||
|
|
Loading…
Reference in New Issue