aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-04-05 19:19:22 +0200
committerlonkaars <l.leblansch@gmail.com>2021-04-05 19:19:22 +0200
commit15df740b1e1ac31a9bb9a2f3a731b693182ebcb9 (patch)
treeb591a7ead71ff8ea935b9095e427c27a261da120
parent0110ede1ccee88161539a194c84c1e1e296ae554 (diff)
fix #5
-rw-r--r--api/rating.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/rating.py b/api/rating.py
index bc49fda..9cf11f5 100644
--- a/api/rating.py
+++ b/api/rating.py
@@ -23,7 +23,7 @@ def get_rating(user_id):
counted_opponents = {}
for game in mapped_games:
# calculate sum score against user (+1 for win, -1 for lose, 0 for draw game)
- counted_opponents |= {game[1]: (counted_opponents.get(game[1]) or 0) + { "w": 1, "l": -1, "d": 0 }[game[2]]}
+ counted_opponents[game[1]] = (counted_opponents.get(game[1]) or 0) + { "w": 1, "l": -1, "d": 0 }[game[2]]
for opponent in counted_opponents:
# apply the cool curve to the sum score and add to the base score of 400
score += rating_v1(counted_opponents.get(opponent))