From bda23b3d2ac4b0b284921d39387802667f4e0213 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:15:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83API=E5=88=9B=E5=BB=BA=E4=B8=8E?= =?UTF-8?q?=E7=88=B6=E8=8A=82=E7=82=B9=E5=90=8C=E5=90=8D=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=8A=A5=E9=94=99=EF=BC=9A=E5=90=8C=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=20(#11858)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/assets/serializers/node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/assets/serializers/node.py b/apps/assets/serializers/node.py index ac161318b..70da291c3 100644 --- a/apps/assets/serializers/node.py +++ b/apps/assets/serializers/node.py @@ -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()