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)
def produce_form(self, **kwargs): return ChangePasswordForm( formdata=MultiDict(kwargs), meta={"csrf": False}, obj=current_user )