def METHOD_NAME(self):
    new_password = request.form['new_password']
    new_password_confirm = request.form['new_password_confirm']
    old_password = request.form['old_password']
    if new_password != new_password_confirm:
        flash('Error: new password did not match', 'warning')
    elif not self._user_db_interface.password_is_correct(current_user.email, old_password):
        flash('Error: wrong password', 'warning')
    elif not password_is_legal(new_password):
        flash('Error: password is not legal. Please choose another password.')
    else:
        with self.user_db_session('Error: could not change password'):
            self._user_db_interface.change_password(current_user.email, new_password)
            flash('password change successful', 'success')