Unverified Commit 8a5e1b82 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #1407 from jokimina/dev_for_pr

[Bugfix] 更新用户信息时不填密码也会触发密码规则验证,导致无法更新
parents 06ce098e f4084c80
...@@ -109,6 +109,7 @@ class UserUpdateView(AdminUserRequiredMixin, SuccessMessageMixin, UpdateView): ...@@ -109,6 +109,7 @@ 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')
if password:
is_ok = check_password_rules(password) is_ok = check_password_rules(password)
if not is_ok: if not is_ok:
form.add_error( form.add_error(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment