From f0421a19def9d9cf4d053b9156570925cf804b08 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 31 Jul 2023 16:17:28 -0500 Subject: [PATCH] Final update to legality check --- cogs/transactions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/transactions.py b/cogs/transactions.py index c7dec40..d3262fd 100644 --- a/cogs/transactions.py +++ b/cogs/transactions.py @@ -140,9 +140,8 @@ class SBaTransaction: mil_wara = 0 this_team = self.teams[team]['team'] # team_roster = await get_players(self.current['season'], this_team['abbrev']) - mil_team = await get_team_by_abbrev(f'{this_team["abbrev"]}MiL', season=this_team['season']) t_query = await db_get('players', params=[ - ('season', self.current['season']), ('team_id', mil_team['id']) + ('season', self.current['season']), ('team_id', this_team['id']) ]) team_roster = t_query['players'] @@ -150,8 +149,9 @@ class SBaTransaction: ('season', self.current['season']), ('team_abbrev', f'{this_team["abbrev"]}MiL') ]) # mil_roster = await get_players(self.current['season'], f'{this_team["abbrev"]}MiL') + mil_team = await get_team_by_abbrev(f'{this_team["abbrev"]}MiL', season=this_team['season']) m_query = await db_get('players', params=[ - ('season', self.current['season']), ('team_abbrev', f'{this_team["abbrev"]}MiL') + ('season', self.current['season']), ('team_id', mil_team['id']) ]) mil_roster = m_query['players'] @@ -219,7 +219,7 @@ class SBaTransaction: # If player is leaving this team next week, remove from roster and subtract WARa if self.players[x]['player']['team'] == this_team: logging.info(f'major league player') - logging.info(f'team roster: {team_roster}') + # logging.info(f'team roster: {team_roster}') team_roster.remove(self.players[x]['player']) # 06-13: COMMENTED OUT TO RESOLVE MID-WEEK IL REPLACEMENT BEING SENT BACK DOWN # if self.effective_week != self.current['week']: @@ -229,7 +229,7 @@ class SBaTransaction: if self.players[x]['player']['team']['abbrev'] == f'{this_team["abbrev"]}MiL': logging.info(f'minor league player') mil_roster.remove(self.players[x]['player']) - logging.info(f'mil roster: {mil_roster}') + # logging.info(f'mil roster: {mil_roster}') if self.effective_week != self.current['week']: mil_wara -= self.players[x]['player']['wara']