From: Ant Zucaro Date: Sun, 7 Oct 2012 12:28:46 +0000 (-0400) Subject: Handle nonexistent elo deltas gracefully. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c65e08ba4183c010fc5c413f0678f43e2bf945e7;p=xonotic%2Fxonstat.git Handle nonexistent elo deltas gracefully. --- diff --git a/xonstat/templates/player_game_index.mako b/xonstat/templates/player_game_index.mako index 1ed3b15..9b60e3c 100644 --- a/xonstat/templates/player_game_index.mako +++ b/xonstat/templates/player_game_index.mako @@ -57,12 +57,16 @@ Recent Games ${g.game_fuzzy} - % if round(g.elo_delta,2) > 0: - - % elif round(g.elo_delta,2) < 0: - + % if g.elo_delta is not None: + % if round(g.elo_delta,2) > 0: + + % elif round(g.elo_delta,2) < 0: + + % else: + + % endif % else: - + % endif diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 34737f6..79ef981 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -457,12 +457,16 @@ Player Information ${game.fuzzy_date()} - % if round(gamestat.elo_delta,2) > 0: - - % elif round(gamestat.elo_delta,2) < 0: - + % if gamestat.elo_delta is not None: + % if round(gamestat.elo_delta,2) > 0: + + % elif round(gamestat.elo_delta,2) < 0: + + % else: + + % endif % else: - + % endif diff --git a/xonstat/views/player.py b/xonstat/views/player.py index 8d3c8bb..d625dff 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -654,7 +654,6 @@ def player_game_index_data(request): ) for row in games.items] except Exception as e: - raise e player = None games = None