perf: modify user login ACL msg

pull/13568/head
wangruidong 2024-07-01 19:28:58 +08:00 committed by w940853815
parent 237b4a82c9
commit c718fe1a9d
5 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

@ -2997,7 +2997,7 @@ msgid "Login confirm ticket was {}"
msgstr ""
#: authentication/errors/failed.py:149
msgid "Current IP and Time period is not allowed"
msgid "Current login is prohibited by ACL rules"
msgstr ""
#: authentication/errors/failed.py:154

View File

@ -3073,8 +3073,8 @@ msgid "Login confirm ticket was {}"
msgstr "ログイン確認チケットは {} でした"
#: authentication/errors/failed.py:149
msgid "Current IP and Time period is not allowed"
msgstr "現在の IP と期間はログインを許可されていません"
msgid "Current login is prohibited by ACL rules"
msgstr "現在のログインはACLルールによって禁止されています"
#: authentication/errors/failed.py:154
msgid "Please enter MFA code"

View File

@ -3026,8 +3026,8 @@ msgid "Login confirm ticket was {}"
msgstr "登录复核: {}"
#: authentication/errors/failed.py:149
msgid "Current IP and Time period is not allowed"
msgstr "当前 IP 和时间段不被允许登录"
msgid "Current login is prohibited by ACL rules"
msgstr "当前登录ACL规则禁止登录"
#: authentication/errors/failed.py:154
msgid "Please enter MFA code"