fix: 用户无效时,企业微信&钉钉扫码 500

This commit is contained in:
xinwen
2021-07-13 20:37:14 +08:00
committed by Jiangjie.Bai
parent 16333fa1aa
commit 8375008cfa

View File

@@ -236,12 +236,13 @@ class AuthMixin:
ip = self.get_request_ip()
request = self.request
self._set_partial_credential_error(user.username, ip, request)
if user.is_expired:
self.raise_credential_error(errors.reason_user_expired)
elif not user.is_active:
self.raise_credential_error(errors.reason_user_inactive)
self._set_partial_credential_error(user.username, ip, request)
self._check_is_local_user(user)
self._check_is_block(user.username)
self._check_login_acl(user, ip)