]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Strip colors too when saving stripped_nick.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 19 Dec 2011 02:04:32 +0000 (21:04 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 19 Dec 2011 02:04:32 +0000 (21:04 -0500)
xonstat/util.py
xonstat/views/submission.py

index 65fa59274390b6c0e25c39c46ae24cdf23310cc0..e2d4e5eb4d6e8bc04dd12fd1c95d34cffb31ba75 100755 (executable)
@@ -72,6 +72,8 @@ def qfont_decode(qstr=''):
 
 
 def strip_colors(qstr=''):
+    if qstr == None:
+        qstr = ''
     return _all_colors.sub('', qstr)
 
 
index e0456be3783d3947e965f3268e869653c23c7050..46ed1aac76f493cd50e5c03920b8318f56b7aa0f 100755 (executable)
@@ -370,7 +370,7 @@ def create_player_game_stat(session=None, player=None,
         pgstat.nick = player.nick\r
 \r
     # whichever nick we ended up with, strip it and store as the stripped_nick\r
-    pgstat.stripped_nick = qfont_decode(pgstat.nick)\r
+    pgstat.stripped_nick = qfont_decode(strip_colors(pgstat.nick))\r
 \r
     # if the nick we end up with is different from the one in the\r
     # player record, change the nick to reflect the new value\r