def update_user(data): user = g.current_user if data['password']: user.change_password(data['password']) db.session.commit() return user