mirror of https://github.com/jumpserver/jumpserver
style: 优化全局组织设置相关代码 (#5921)
* feat:支持配置全局组织的显示名称 * style: 优化全局组织设置相关代码 Co-authored-by: liubo <liubo@fit2cloud.com>pull/5922/head
parent
8b1e202e68
commit
8895763ab4
|
@ -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…
Reference in New Issue