mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-23 02:53:15 +00:00
Merge remote-tracking branch 'github/dev' into dev
This commit is contained in:
commit
4c8eb4a94b
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,12 +109,13 @@ class UserUpdateView(AdminUserRequiredMixin, SuccessMessageMixin, UpdateView):
|
|||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
password = form.cleaned_data.get('password')
|
password = form.cleaned_data.get('password')
|
||||||
is_ok = check_password_rules(password)
|
if password:
|
||||||
if not is_ok:
|
is_ok = check_password_rules(password)
|
||||||
form.add_error(
|
if not is_ok:
|
||||||
"password", _("* Your password does not meet the requirements")
|
form.add_error(
|
||||||
)
|
"password", _("* Your password does not meet the requirements")
|
||||||
return self.form_invalid(form)
|
)
|
||||||
|
return self.form_invalid(form)
|
||||||
|
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
@ -51,11 +51,6 @@ class Config:
|
|||||||
REDIS_HOST = '127.0.0.1'
|
REDIS_HOST = '127.0.0.1'
|
||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_PASSWORD = ''
|
REDIS_PASSWORD = ''
|
||||||
BROKER_URL = 'redis://%(password)s%(host)s:%(port)s/3' % {
|
|
||||||
'password': REDIS_PASSWORD,
|
|
||||||
'host': REDIS_HOST,
|
|
||||||
'port': REDIS_PORT,
|
|
||||||
}
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user