mirror of https://github.com/jumpserver/jumpserver
style: 优化全局组织设置相关代码 (#5921)
* feat:支持配置全局组织的显示名称 * style: 优化全局组织设置相关代码 Co-authored-by: liubo <liubo@fit2cloud.com>pull/5953/head^2
parent
1ac8537a34
commit
4e7e1d5e15
|
@ -193,7 +193,8 @@ class Organization(models.Model):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def root(cls):
|
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):
|
def is_root(self):
|
||||||
return self.id == self.ROOT_ID
|
return self.id == self.ROOT_ID
|
||||||
|
|
Loading…
Reference in New Issue