From 4e7e1d5e1585224a00d8e760ef0549694d6011fe Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 8 Apr 2021 14:18:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=AE=BE=E7=BD=AE=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20(#5921)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:支持配置全局组织的显示名称 * style: 优化全局组织设置相关代码 Co-authored-by: liubo --- apps/orgs/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/orgs/models.py b/apps/orgs/models.py index 310bc709a..72f47e1e3 100644 --- a/apps/orgs/models.py +++ b/apps/orgs/models.py @@ -193,7 +193,8 @@ class Organization(models.Model): @classmethod def root(cls): - return cls(id=cls.ROOT_ID, name=settings.GLOBAL_ORG_DISPLAY_NAME if settings.GLOBAL_ORG_DISPLAY_NAME else cls.ROOT_NAME) + name = settings.GLOBAL_ORG_DISPLAY_NAME or cls.ROOT_NAME + return cls(id=cls.ROOT_ID, name=name) def is_root(self): return self.id == self.ROOT_ID