diff --git a/apps/authentication/errors/failed.py b/apps/authentication/errors/failed.py index 729d93b6d..9b93242e2 100644 --- a/apps/authentication/errors/failed.py +++ b/apps/authentication/errors/failed.py @@ -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): diff --git a/apps/authentication/mixins.py b/apps/authentication/mixins.py index 0bd0c1b47..99526e156 100644 --- a/apps/authentication/mixins.py +++ b/apps/authentication/mixins.py @@ -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' diff --git a/apps/i18n/core/en/LC_MESSAGES/django.po b/apps/i18n/core/en/LC_MESSAGES/django.po index bcea4c95c..a9a08a180 100644 --- a/apps/i18n/core/en/LC_MESSAGES/django.po +++ b/apps/i18n/core/en/LC_MESSAGES/django.po @@ -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 diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index 15bb390ea..30bd19b51 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/ja/LC_MESSAGES/django.po @@ -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" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index a6e7b5a4a..bcda9c3c2 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh/LC_MESSAGES/django.po @@ -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"