From 75aacd0da64fb8470d97d39936843026b2fbde96 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:08:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86bug=20(#8531)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- apps/authentication/errors/redirect.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/authentication/errors/redirect.py b/apps/authentication/errors/redirect.py index f41bda818..bf334133d 100644 --- a/apps/authentication/errors/redirect.py +++ b/apps/authentication/errors/redirect.py @@ -23,7 +23,7 @@ class NeedMoreInfoError(Exception): class NeedRedirectError(JMSException): - def __init__(self, url): + def __init__(self, url, *args, **kwargs): self.url = url @@ -79,8 +79,7 @@ class PasswordTooSimple(NeedRedirectError): default_detail = _('Your password is too simple, please change it for security') def __init__(self, url, *args, **kwargs): - super().__init__(*args, **kwargs) - self.url = url + super().__init__(url, *args, **kwargs) class PasswordNeedUpdate(NeedRedirectError): @@ -88,8 +87,7 @@ class PasswordNeedUpdate(NeedRedirectError): default_detail = _('You should to change your password before login') def __init__(self, url, *args, **kwargs): - super().__init__(*args, **kwargs) - self.url = url + super().__init__(url, *args, **kwargs) class PasswordRequireResetError(NeedRedirectError): @@ -97,13 +95,12 @@ class PasswordRequireResetError(NeedRedirectError): default_detail = _('Your password has expired, please reset before logging in') def __init__(self, url, *args, **kwargs): - super().__init__(*args, **kwargs) - self.url = url + super().__init__(url, *args, **kwargs) class MFAUnsetError(NeedRedirectError): error = const.reason_mfa_unset msg = const.mfa_unset_msg - def __init__(self, url, user, request): - self.url = url + def __init__(self, url, *args, **kwargs): + super().__init__(url, *args, **kwargs)