From: Ant Zucaro Date: Tue, 6 Dec 2011 17:30:06 +0000 (-0500) Subject: Hotfix for malformed match_ids: remove leading '0.'. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=50b7b31dfb35f91f6f1827bb7b2664563143c68d;p=xonotic%2Fxonstat.git Hotfix for malformed match_ids: remove leading '0.'. 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. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 09c0bb6..36a9b1a 100755 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -449,6 +449,10 @@ def parse_body(request): value = unicode(value, 'utf-8') if key in 'V' 'T' 'G' 'M' 'S' 'C' 'R' 'W' 'I': + # FIXME: hotfix for malformed numbers in the match_id + if key == 'I' and value.startswith('0.'): + value = value[2:] + game_meta[key] = value if key == 'P':