Commit 90ec6a29 authored by BaiJiangJie's avatar BaiJiangJie Committed by 老广

[Bugfix] 修复创建资产节点的Bug (#3308)

parent 16d2b0f1
...@@ -25,10 +25,12 @@ class NodeSerializer(BulkOrgResourceModelSerializer): ...@@ -25,10 +25,12 @@ class NodeSerializer(BulkOrgResourceModelSerializer):
read_only_fields = ['key', 'org_id'] read_only_fields = ['key', 'org_id']
def validate_value(self, data): def validate_value(self, data):
if not self.instance and not data: if self.instance:
return data instance = self.instance
instance = self.instance siblings = instance.get_siblings()
siblings = instance.get_siblings() else:
instance = Node.org_root()
siblings = instance.get_children()
if siblings.filter(value=data): if siblings.filter(value=data):
raise serializers.ValidationError( raise serializers.ValidationError(
_('The same level node name cannot be the same') _('The same level node name cannot be the same')
......
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