From: Ant Zucaro Date: Mon, 19 Dec 2011 02:04:32 +0000 (-0500) Subject: Strip colors too when saving stripped_nick. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3cf3ad66266e4785acb1f36ce39af05f92f722c4;p=xonotic%2Fxonstat.git Strip colors too when saving stripped_nick. --- diff --git a/xonstat/util.py b/xonstat/util.py index 65fa592..e2d4e5e 100755 --- a/xonstat/util.py +++ b/xonstat/util.py @@ -72,6 +72,8 @@ def qfont_decode(qstr=''): def strip_colors(qstr=''): + if qstr == None: + qstr = '' return _all_colors.sub('', qstr) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index e0456be..46ed1aa 100755 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -370,7 +370,7 @@ def create_player_game_stat(session=None, player=None, pgstat.nick = player.nick # whichever nick we ended up with, strip it and store as the stripped_nick - pgstat.stripped_nick = qfont_decode(pgstat.nick) + pgstat.stripped_nick = qfont_decode(strip_colors(pgstat.nick)) # if the nick we end up with is different from the one in the # player record, change the nick to reflect the new value