def update_sport(self, sport_id: str, sport_data: dict): self._check_profile_data(sport_data, update=True) with self._database_engine.new_session() as session: sport_dao = SportDAO(session) sport = sport_dao.get(sport_id) sport = sport_dao.update(sport, sport_data) return sport.to_dict()
def update_sport(self, sport_id, sport_data): with self._database_engine.new_session() as session: sport_dao = SportDAO(session) sport = sport_dao.get(sport_id) sport = sport_dao.update(sport, sport_data) return sport.to_dict()
def update_sport(self, sport_id, sport_data): logging.info("Update sport %s with data: %s" % (sport_id, str(sport_data))) self._check_sport_data(sport_data, update=True) with self._database_engine.new_session() as session: dao = SportDAO(session) sport = dao.get(sport_id) sport = dao.update(sport, sport_data) return sport.to_dict()