fix: 用户登录错误处理bug (#8531)

Co-authored-by: feng626 <1304903146@qq.com>
pull/8554/head
fit2bot 2 years ago committed by GitHub
parent 0aad0b7279
commit 75aacd0da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save