From be58539df8c107abbfb805530efcc16a8cad2fe6 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 20 Apr 2023 14:19:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E6=94=AF=E6=8C=81=20?= =?UTF-8?q?i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/utils/yml.py | 4 ++-- apps/rbac/const.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/common/utils/yml.py b/apps/common/utils/yml.py index 540f1a31f..ccc151c8c 100644 --- a/apps/common/utils/yml.py +++ b/apps/common/utils/yml.py @@ -1,12 +1,12 @@ import io import yaml -from django.utils.translation import get_language +from django.conf import settings from jinja2 import Environment def translate(i18n, key): - lang = get_language()[:2] + lang = settings.LANGUAGE_CODE[:2] lang_data = i18n.get(key, {}) return lang_data.get(lang, key) diff --git a/apps/rbac/const.py b/apps/rbac/const.py index 4ab48161c..786cb74cc 100644 --- a/apps/rbac/const.py +++ b/apps/rbac/const.py @@ -146,6 +146,8 @@ only_system_permissions = ( ('authentication', '*', '*', '*'), ('tickets', '*', '*', '*'), ('orgs', 'organization', 'view', 'rootorg'), + ('terminal', 'applet', '*', '*'), + ('terminal', 'applethost', '*', '*'), ) only_org_permissions = (