Skip to content

Commit

Permalink
[Hockey] Fix some keyerrors in standings data
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Oct 4, 2024
1 parent 4555676 commit 10433f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion hockey/hockeyset.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ async def set_team_events(self, ctx: commands.Context, team: TeamFinder):
edited = 0
async with ctx.typing():
for game in games:

start = game.game_start
end = start + timedelta(hours=3)
home = game.home_team
Expand Down
6 changes: 3 additions & 3 deletions hockey/standings.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ def from_nhle(cls, data: dict) -> TeamRecord:
streak = Streak(
**{
"streakType": "wins",
"streakNumber": data["streakCount"],
"streakCode": data["streakCode"],
"streakNumber": data.get("streakCount", 0),
"streakCode": data.get("streakCode", "N/A"),
}
)
return cls(
Expand Down Expand Up @@ -456,7 +456,7 @@ def from_nhle(cls, data: dict) -> TeamRecord:
row=0,
games_played=int(data["gamesPlayed"]),
streak=streak,
points_percentage=float(data["pointPctg"]),
points_percentage=float(data.get("pointPctg", 0.0)),
pp_division_rank=0,
pp_conference_rank=0,
pp_league_rank=0,
Expand Down

0 comments on commit 10433f3

Please sign in to comment.