def change_password(): page = dict(title="Needs Report") form = ChangePassword() if form.validate_on_submit(): user = User.query.filter_by(email=current_user.email).first() user.set_password(form.password.data) db.session.add(user) db.session.commit() flash('Password changed') return redirect(url_for('volunteer.index')) return render_template('volunteers/change_password.html', page=page, volunteer=volunteer, form=form)
def change_password(): page = dict(title="Change Password") form = ChangePassword() if form.validate_on_submit(): user = User.query.filter_by(email=current_user.email).first() user.set_password(form.password.data) db.session.add(user) db.session.commit() flash('Password changed') return redirect(url_for('coordinator.overview')) return render_template('coordinators/change_password.html', page=page, form=form)