fix(assets): 修复获取org_root的问题

pull/5032/head
ibuler 2020-11-18 11:18:29 +08:00 committed by Jiangjie.Bai
parent f557c1dace
commit 6ec0b3ad54
1 changed files with 3 additions and 1 deletions

View File

@ -352,7 +352,9 @@ class SomeNodesMixin:
@classmethod @classmethod
def org_root(cls): 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: if root:
return root[0] return root[0]
else: else: