Align home_score with runs_scored for pythag record

This commit is contained in:
Peter 2024-11-15 16:52:29 -06:00
parent ffb70f1633
commit c5b546d0ed

View File

@ -608,8 +608,8 @@ class Team(BaseModel):
fn.SUM(StratGame.away_score).alias('r_them') fn.SUM(StratGame.away_score).alias('r_them')
).where((StratGame.home_team == self) & StratGame.game_num.is_null(False)) ).where((StratGame.home_team == self) & StratGame.game_num.is_null(False))
if home_games.count() > 0: if home_games.count() > 0:
runs_scored += home_games[0].r_them runs_scored += home_games[0].r_us
runs_allowed += home_games[0].r_us runs_allowed += home_games[0].r_them
if runs_allowed == 0: if runs_allowed == 0:
pythag_win_pct = 1 pythag_win_pct = 1