Bug fixes

This commit is contained in:
Cal Corum 2024-07-14 13:23:49 -05:00
parent 6308d32f8e
commit af2baa493c
2 changed files with 4 additions and 4 deletions

View File

@ -280,7 +280,7 @@ class SBaTransaction:
async def send_transaction(self): async def send_transaction(self):
team_id = list(self.teams.keys())[0] team_id = list(self.teams.keys())[0]
moveid = f'Week-{self.effective_week:0>2}-{datetime.datetime.now().strftime("%d-%H:%M:%S")}' moveid = f'Season-{self.current["season"]:03d}-Week-{self.effective_week:0>2}-{datetime.datetime.now().strftime("%d-%H:%M:%S")}'
moves = [] moves = []
logging.warning(f'move_id: {moveid} / move_type: {self.move_type} / avoid_freeze: {self.avoid_freeze} / ' logging.warning(f'move_id: {moveid} / move_type: {self.move_type} / avoid_freeze: {self.avoid_freeze} / '

View File

@ -98,9 +98,9 @@ async def db_post(endpoint: str, api_ver: int = 3, payload: dict = None, timeout
raise ValueError(f'DB: {e}') raise ValueError(f'DB: {e}')
async def db_put(endpoint: str, api_ver: int = 2, payload: dict = None, object_id: int = None, timeout: int = 3): async def db_put(endpoint: str, api_ver: int = 3, payload: dict = None, object_id: int = None, timeout: int = 3):
req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id) req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id)
log_string = f'post:\n{endpoint} payload: {payload}\nobject_id: {object_id}\ntype: {type(payload)}' log_string = f'put:{req_url}\npayload: {payload}\nobject_id: {object_id}\ntype: {type(payload)}'
logging.info(log_string) if master_debug else logging.debug(log_string) logging.info(log_string) if master_debug else logging.debug(log_string)
async with aiohttp.ClientSession(headers=AUTH_TOKEN) as session: async with aiohttp.ClientSession(headers=AUTH_TOKEN) as session:
@ -189,7 +189,7 @@ async def get_player_by_name(season: int, player_name: str):
async def put_player(this_player: dict): async def put_player(this_player: dict):
this_player['team_id'] = this_player['team']['id'] this_player['team_id'] = this_player['team']['id']
return await db_put('players', object_id=this_player['id'], params=[], payload=this_player) return await db_put('players', object_id=this_player['id'], payload=this_player)
async def patch_draftpick(this_pick: dict): async def patch_draftpick(this_pick: dict):