Merge pull request #3907 from jumpserver/dev_user

[Update] 修改忘记密码页面的错误信息提示
pull/3908/head
BaiJiangJie 5 years ago committed by GitHub
commit 1de2923dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,11 +43,13 @@ class UserForgotPasswordView(FormView):
user = get_object_or_none(User, email=email)
if not user:
error = _('Email address invalid, please input again')
return self.get(request, errors=error)
form.add_error('email', error)
return self.form_invalid(form)
elif not user.can_update_password():
error = _('User auth from {}, go there change password'.format(
user.source))
return self.get(request, errors=error)
form.add_error('email', error)
return self.form_invalid(form)
else:
send_reset_password_mail(user)
return redirect('users:forgot-password-sendmail-success')

Loading…
Cancel
Save