Example #1
0
def change_password():
    form = ChangePasswordForm()
    if form.validate_on_submit():
        current_user.password = form.new_password.data
        current_user.save()

        flash(_("Password updated."), "success")
    return render_template("user/change_password.html", form=form)
Example #2
0
def change_password():
    form = ChangePasswordForm()
    if form.validate_on_submit():
        current_user.password = form.new_password.data
        current_user.save()

        flash(_("Password updated."), "success")
    return render_template("user/change_password.html", form=form)
Example #3
0
 def produce_form(self, **kwargs):
     return ChangePasswordForm(
         formdata=MultiDict(kwargs), meta={"csrf": False}, obj=current_user
     )