Browse Source

style: 优化全局组织设置相关代码 (#5921)

* feat:支持配置全局组织的显示名称

* style: 优化全局组织设置相关代码

Co-authored-by: liubo <liubo@fit2cloud.com>
pull/5922/head
fit2bot 4 years ago committed by GitHub
parent
commit
8895763ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/orgs/models.py

3
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

Loading…
Cancel
Save