mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
fix: 调API创建与父节点同名的子节点报错:同级别节点名称不能重复 (#11858)
Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user