perf: 修改用户登录 ACL 翻译信息

pull/8687/head
Jiangjie.Bai 2022-08-02 14:28:58 +08:00 committed by Jiangjie.Bai
parent e8b4ee5c40
commit 9319c4748c
4 changed files with 17 additions and 15 deletions

View File

@ -138,11 +138,11 @@ class ACLError(AuthFailedNeedLogMixin, AuthFailedError):
}
class LoginACLNotAllowed(ACLError):
class LoginACLIPAndTimePeriodNotAllowed(ACLError):
def __init__(self, username, request, **kwargs):
self.username = username
self.request = request
super().__init__(_("ACL is not allowed"), **kwargs)
super().__init__(_("Current IP and Time period is not allowed"), **kwargs)
class MFACodeRequiredError(AuthFailedError):

View File

@ -337,7 +337,7 @@ class AuthACLMixin:
return
if acl.is_action(acl.ActionChoices.reject):
raise errors.LoginACLNotAllowed(username=user.username, request=self.request)
raise errors.LoginACLIPAndTimePeriodNotAllowed(user.username, request=self.request)
if acl.is_action(acl.ActionChoices.confirm):
self.request.session['auth_confirm_required'] = '1'

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-29 10:56+0800\n"
"POT-Creation-Date: 2022-08-02 11:39+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1915,9 +1915,9 @@ msgstr "このアカウントは期限切れです"
msgid "Auth backend not match"
msgstr "Authバックエンドが一致しない"
#: authentication/errors/const.py:28 authentication/errors/failed.py:145
#: authentication/errors/const.py:28
msgid "ACL is not allowed"
msgstr "ACLは許可されません"
msgstr "ログイン アクセス制御は許可されません"
#: authentication/errors/const.py:29
msgid "Only local users are allowed"
@ -1983,6 +1983,10 @@ msgstr "受け入れのためのログイン確認チケットを待つ"
msgid "Login confirm ticket was {}"
msgstr "ログイン確認チケットは {} でした"
#: authentication/errors/failed.py:145
msgid "Current IP and Time period is not allowed"
msgstr "現在の IP と期間はログインを許可されていません"
#: authentication/errors/failed.py:150
msgid "Please enter MFA code"
msgstr "MFAコードを入力してください"
@ -6858,8 +6862,5 @@ msgstr "コミュニティ版"
#~ msgid "IP is not allowed"
#~ msgstr "IPは許可されていません"
#~ msgid "Time Period is not allowed"
#~ msgstr "期間は許可されていません"
#~ msgid "User cannot self-update fields: {}"
#~ msgstr "ユーザーは自分のフィールドを更新できません: {}"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-29 10:56+0800\n"
"POT-Creation-Date: 2022-08-02 11:39+0800\n"
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -1901,9 +1901,9 @@ msgstr "此账号已过期"
msgid "Auth backend not match"
msgstr "没有匹配到认证后端"
#: authentication/errors/const.py:28 authentication/errors/failed.py:145
#: authentication/errors/const.py:28
msgid "ACL is not allowed"
msgstr "ACL 不被允许"
msgstr "登录访问控制不被允许"
#: authentication/errors/const.py:29
msgid "Only local users are allowed"
@ -1963,6 +1963,10 @@ msgstr "等待登录复核处理"
msgid "Login confirm ticket was {}"
msgstr "登录复核: {}"
#: authentication/errors/failed.py:145
msgid "Current IP and Time period is not allowed"
msgstr "当前 IP 和时间段不被允许登录"
#: authentication/errors/failed.py:150
msgid "Please enter MFA code"
msgstr "请输入 MFA 验证码"
@ -6761,8 +6765,5 @@ msgstr "社区版"
#~ msgid "IP is not allowed"
#~ msgstr "来源 IP 不被允许登录"
#~ msgid "Time Period is not allowed"
#~ msgstr "该 时间段 不被允许登录"
#~ msgid "User cannot self-update fields: {}"
#~ msgstr "用户不能更新自己的字段: {}"