fix(auth): 修复用户登录失败次数出现0次

This commit is contained in:
xinwen
2020-10-27 18:43:41 +08:00
committed by 老广
parent e2f540a1f4
commit 7031b7f28b
2 changed files with 7 additions and 2 deletions

View File

@@ -87,6 +87,7 @@ class UserLoginView(mixins.AuthMixin, FormView):
try:
self.check_user_auth(decrypt_passwd=True)
except errors.AuthFailedError as e:
e = self.check_is_block(raise_exception=False) or e
form.add_error(None, e.msg)
ip = self.get_request_ip()
cache.set(self.key_prefix_captcha.format(ip), 1, 3600)