From 6ec0b3ad541139a7a78a67556ad23e186b15a335 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 18 Nov 2020 11:18:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(assets):=20=E4=BF=AE=E5=A4=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96org=5Froot=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/models/node.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/assets/models/node.py b/apps/assets/models/node.py index 6461ec955..e88afccdc 100644 --- a/apps/assets/models/node.py +++ b/apps/assets/models/node.py @@ -352,7 +352,9 @@ class SomeNodesMixin: @classmethod def org_root(cls): - root = cls.objects.filter(parent_key='').exclude(key__startswith='-') + root = cls.objects.filter(parent_key='')\ + .filter(key__regex=r'^[0-9]+$')\ + .exclude(key__startswith='-') if root: return root[0] else: