提交 1ac8537a 编写于 作者: L liuboF2c 提交者: xinwen

feat:支持配置全局组织的显示名称 (#5919)

Co-authored-by: Nliubo <liubo@fit2cloud.com>
上级 dcaa798c
......@@ -143,6 +143,7 @@ class Config(dict):
'REDIS_DB_SESSION': 5,
'REDIS_DB_WS': 6,
'GLOBAL_ORG_DISPLAY_NAME': '',
'SITE_URL': 'http://localhost:8080',
'CAPTCHA_TEST_MODE': None,
'TOKEN_EXPIRATION': 3600 * 24,
......
......@@ -120,3 +120,6 @@ CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED
FORGOT_PASSWORD_URL = CONFIG.FORGOT_PASSWORD_URL
# 自定义默认组织名
GLOBAL_ORG_DISPLAY_NAME = CONFIG.GLOBAL_ORG_DISPLAY_NAME
......@@ -2077,6 +2077,14 @@ msgstr "用户第一次登录,修改profile后重定向到地址, 可以是 wi
msgid "Forgot password url"
msgstr "忘记密码URL"
#: settings/serializers/settings.py:23
msgid "Global organization name"
msgstr "全局组织名"
#: settings/serializers/settings.py:23
msgid "The name of global organization to display"
msgstr "全局组织的显示名称,默认为 全局组织"
#: settings/serializers/settings.py:24
msgid ""
"The forgot password url on login page, If you use ldap or cas external "
......
......@@ -7,7 +7,7 @@ from django.db.models import signals
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from common.utils import is_uuid, lazyproperty
from common.utils import lazyproperty, settings
from common.const import choices
from common.db.models import ChoiceSet
......@@ -193,7 +193,7 @@ class Organization(models.Model):
@classmethod
def root(cls):
return cls(id=cls.ROOT_ID, name=cls.ROOT_NAME)
return cls(id=cls.ROOT_ID, name=settings.GLOBAL_ORG_DISPLAY_NAME if settings.GLOBAL_ORG_DISPLAY_NAME else cls.ROOT_NAME)
def is_root(self):
return self.id == self.ROOT_ID
......
......@@ -24,6 +24,10 @@ class BasicSettingSerializer(serializers.Serializer):
help_text=_('The forgot password url on login page, If you use '
'ldap or cas external authentication, you can set it')
)
GLOBAL_ORG_DISPLAY_NAME = serializers.CharField(
required=False, max_length=1024, allow_blank=True, allow_null=True, label=_("Global organization name"),
help_text=_('The name of global organization to display')
)
class EmailSettingSerializer(serializers.Serializer):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册