]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Hotfix for malformed match_ids: remove leading '0.'.
authorAnt Zucaro <azucaro@gmail.com>
Tue, 6 Dec 2011 17:30:06 +0000 (12:30 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Tue, 6 Dec 2011 17:30:06 +0000 (12:30 -0500)
Match ids are coming in as 0.1234.5678, which doesn't resolve to a
number. This commit identifies such malformed numbers and removes their
leading '0.'s. This is an ugly fix, but hopefully someone can address
the source of that number for the permanent fix.

xonstat/views/submission.py

index 09c0bb6156bdaa061d626410d22b8fc67f283e6d..36a9b1a53f1f87e358f70140d11864f8ee44337e 100755 (executable)
@@ -449,6 +449,10 @@ def parse_body(request):
                 value = unicode(value, 'utf-8')\r
 \r
             if key in 'V' 'T' 'G' 'M' 'S' 'C' 'R' 'W' 'I':\r
+                # FIXME: hotfix for malformed numbers in the match_id\r
+                if key == 'I' and value.startswith('0.'):\r
+                    value = value[2:]\r
+\r
                 game_meta[key] = value\r
 \r
             if key == 'P':\r