mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复用户失效日期截止后还可登录问题
parent
5464ac8167
commit
221fae5875
|
@ -16,13 +16,14 @@ class UserLoginForm(AuthenticationForm):
|
||||||
max_length=128, strip=False
|
max_length=128, strip=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def confirm_login_allowed(self, user):
|
||||||
|
if not user.is_staff:
|
||||||
|
raise forms.ValidationError(
|
||||||
|
self.error_messages['inactive'],
|
||||||
|
code='inactive',)
|
||||||
|
|
||||||
class UserLoginCaptchaForm(AuthenticationForm):
|
|
||||||
username = forms.CharField(label=_('Username'), max_length=100)
|
class UserLoginCaptchaForm(UserLoginForm):
|
||||||
password = forms.CharField(
|
|
||||||
label=_('Password'), widget=forms.PasswordInput,
|
|
||||||
max_length=128, strip=False
|
|
||||||
)
|
|
||||||
captcha = CaptchaField()
|
captcha = CaptchaField()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue