fix: 修复登录次数出现 0

pull/7069/head
xinwen 2021-10-25 11:32:13 +08:00 committed by Jiangjie.Bai
parent 25d1b71448
commit 7d56678a8e
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ class CredentialError(AuthFailedNeedLogMixin, AuthFailedNeedBlockMixin, AuthFail
times_remainder = util.get_remainder_times()
block_time = settings.SECURITY_LOGIN_LIMIT_TIME
if times_remainder < 1:
self.msg = block_login_msg.format(settings.SECURITY_LOGIN_LIMIT_TIME)
return
default_msg = invalid_login_msg.format(
times_try=times_remainder, block_time=block_time
)