From 15df740b1e1ac31a9bb9a2f3a731b693182ebcb9 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 5 Apr 2021 19:19:22 +0200 Subject: fix #5 --- api/rating.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api') 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)) -- cgit v1.2.3