Skip to content

Commit

Permalink
Fix user statistics for users that never won a game
Browse files Browse the repository at this point in the history
  • Loading branch information
ishefi committed Mar 9, 2024
1 parent 4cd3f17 commit c77cd0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logic/user_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ async def get_statistics(self) -> schemas.UserStatistics:
game_streak=game_streak,
highest_rank=highest_rank,
total_games_played=total_games_played,
total_games_won=total_games_won,
average_guesses=avg_guesses,
total_games_won=total_games_won or 0,
average_guesses=avg_guesses or 0,
)

def _get_game_streak_and_total(self) -> tuple[int, int]:
Expand Down

0 comments on commit c77cd0b

Please sign in to comment.