From 4035cab32194d0cff45877a1dc8dfb647814d7b8 Mon Sep 17 00:00:00 2001 From: Strogoo Date: Sat, 21 Mar 2020 02:02:32 +0300 Subject: [PATCH] Hotfix due to API issues Fixing API might take some time, so it's better to display user name as "No data" rather than throwing an error. --- src/replays/replayitem.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/replays/replayitem.py b/src/replays/replayitem.py index acff1ac92..01a38047f 100644 --- a/src/replays/replayitem.py +++ b/src/replays/replayitem.py @@ -304,6 +304,9 @@ def generatePlayerHTML(self, i, player): else: alignment = "left" + if "login" not in player["player"]: + player["player"]["login"] = "No data" + playerLabel = self.FORMATTER_REPLAY_PLAYER_LABEL.format(player_name=player["player"]["login"], player_rating= int(round((player["beforeMean"] - player["beforeDeviation"] * 3)/100) * 100), alignment=alignment)