Skip to content

Commit

Permalink
fix error in serializing entity end of non ranked game
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 authored Apr 16, 2024
1 parent 65908de commit a599e6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions db/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,16 @@ async def to_dict(self) -> dict:
final["score"] = self.score
final["current_rating_mu"] = self.current_rating_mu
final["current_rating_sigma"] = self.current_rating_sigma
final["current_rating"] = self.current_rating_mu - 3 * self.current_rating_sigma
if self.current_rating_mu and self.current_rating sigma:
final["current_rating"] = self.current_rating_mu - 3 * self.current_rating_sigma
else:
final["current_rating"] = None
final["previous_rating_mu"] = self.previous_rating_mu
final["previous_rating_sigma"] = self.previous_rating_sigma
final["previous_rating"] = self.previous_rating_mu - 3 * self.previous_rating_sigma
if self.previous_rating_mu and self.previous_rating_sigma:
final["previous_rating"] = self.previous_rating_mu - 3 * self.previous_rating_sigma
else:
final["previous_rating"] = None

return final

Expand Down

0 comments on commit a599e6a

Please sign in to comment.