mirror of https://github.com/jumpserver/jumpserver
Merge remote-tracking branch 'github/dev' into dev
commit
4c8eb4a94b
|
@ -16,13 +16,14 @@ class UserLoginForm(AuthenticationForm):
|
|||
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)
|
||||
password = forms.CharField(
|
||||
label=_('Password'), widget=forms.PasswordInput,
|
||||
max_length=128, strip=False
|
||||
)
|
||||
|
||||
class UserLoginCaptchaForm(UserLoginForm):
|
||||
captcha = CaptchaField()
|
||||
|
||||
|
||||
|
|
|
@ -109,12 +109,13 @@ class UserUpdateView(AdminUserRequiredMixin, SuccessMessageMixin, UpdateView):
|
|||
|
||||
def form_valid(self, form):
|
||||
password = form.cleaned_data.get('password')
|
||||
is_ok = check_password_rules(password)
|
||||
if not is_ok:
|
||||
form.add_error(
|
||||
"password", _("* Your password does not meet the requirements")
|
||||
)
|
||||
return self.form_invalid(form)
|
||||
if password:
|
||||
is_ok = check_password_rules(password)
|
||||
if not is_ok:
|
||||
form.add_error(
|
||||
"password", _("* Your password does not meet the requirements")
|
||||
)
|
||||
return self.form_invalid(form)
|
||||
|
||||
return super().form_valid(form)
|
||||
|
||||
|
|
|
@ -51,11 +51,6 @@ class Config:
|
|||
REDIS_HOST = '127.0.0.1'
|
||||
REDIS_PORT = 6379
|
||||
REDIS_PASSWORD = ''
|
||||
BROKER_URL = 'redis://%(password)s%(host)s:%(port)s/3' % {
|
||||
'password': REDIS_PASSWORD,
|
||||
'host': REDIS_HOST,
|
||||
'port': REDIS_PORT,
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue