From c118c0c1c27605e1a52d7a9738841993b35817b7 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 7 Oct 2012 08:28:46 -0400 Subject: [PATCH] Handle nonexistent elo deltas gracefully. --- xonstat/templates/player_game_index.mako | 14 +++++++++----- xonstat/templates/player_info.mako | 14 +++++++++----- xonstat/views/player.py | 1 - 3 files changed, 18 insertions(+), 11 deletions(-) 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 -- 2.39.2