From dce17d506dbf19e036cf86ca2dd85d7e9fe5ef13 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Wed, 26 Sep 2012 08:52:07 -0400 Subject: [PATCH] Don't show ratios if they are undefined. --- xonstat/templates/player_info.mako | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index bdea7a5..10ec1ad 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -226,7 +226,9 @@ Player Information

% if g.game_type_cd in overall_stats: - Kill Ratio: ${round(overall_stats[g.game_type_cd].k_d_ratio,2)} (${overall_stats[g.game_type_cd].total_kills} kills, ${overall_stats[g.game_type_cd].total_deaths} deaths)
+ % if overall_stats[g.game_type_cd].k_d_ratio is not None: + Kill Ratio: ${round(overall_stats[g.game_type_cd].k_d_ratio,2)} (${overall_stats[g.game_type_cd].total_kills} kills, ${overall_stats[g.game_type_cd].total_deaths} deaths)
+ % endif % endif % if g.game_type_cd in elos: @@ -247,7 +249,9 @@ Player Information % endif % if g.game_type_cd == 'ctf': - Cap Ratio: ${round(overall_stats[g.game_type_cd].cap_ratio,2)} (${overall_stats[g.game_type_cd].total_captures} captures, ${overall_stats[g.game_type_cd].total_pickups} pickups)
+ % if overall_stats[g.game_type_cd].cap_ratio is not None: + Cap Ratio: ${round(overall_stats[g.game_type_cd].cap_ratio,2)} (${overall_stats[g.game_type_cd].total_captures} captures, ${overall_stats[g.game_type_cd].total_pickups} pickups)
+ % endif % endif

-- 2.39.2