From eca69fe13c2423bef4806e47d9115ab2ef0516c4 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sun, 29 Oct 2023 00:49:36 -0500 Subject: [PATCH] Bug fixes --- app/card_creation.py | 4 ++-- app/routers_v2/stratplays.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/card_creation.py b/app/card_creation.py index d9528ee..cee4a99 100644 --- a/app/card_creation.py +++ b/app/card_creation.py @@ -436,8 +436,8 @@ class CardColumn(pydantic.BaseModel): self.two.assign_play(play) return chances, 0 elif not self.twelve.is_full(): - self.five.result_one = play.full_name - self.twelve.result_one = play.full_name + self.five.assign_play(play) + self.twelve.assign_play(play) return chances, 0 # Plus one diff --git a/app/routers_v2/stratplays.py b/app/routers_v2/stratplays.py index 54e99e4..f6309aa 100644 --- a/app/routers_v2/stratplays.py +++ b/app/routers_v2/stratplays.py @@ -589,9 +589,12 @@ async def get_batting_totals( x['player_cardset'] = x['player']['cardset']['name'] x['team_id'] = x['team']['id'] x['team_abbrev'] = x['team']['abbrev'] - x['game_id'] = x['game']['id'] - x['game_type'] = x['game']['game_type'] - del x['player'], x['team'], x['game'] + if 'id' in x['game']: + x['game_id'] = x['game']['id'] + if 'game_type' in x['game']: + x['game_type'] = x['game']['game_type'] + del x['game'] + del x['player'], x['team'] output = pd.DataFrame(return_vals) first = ['player_id', 'player_name', 'player_cardset', 'team_id', 'team_abbrev']