]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Fix imports.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 7 Nov 2016 19:38:37 +0000 (14:38 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 7 Nov 2016 19:38:37 +0000 (14:38 -0500)
xonstat/elo.py
xonstat/views/submission.py

index 01a1e8a93728fdbd8ce81d70efc65ed42a611cc8..bc0c332529fa8d70b4ae4e5c03cbcbe045b09b39 100644 (file)
@@ -96,10 +96,12 @@ class EloProcessor:
 
         # used to determine if a pgstat record is elo-eligible
         def elo_eligible(pgs):
-            return pgs.player_id > 2 and pgs.alivetime > timedelta(seconds=0)
+            return pgs.player_id > 2 and pgs.alivetime > datetime.timedelta(seconds=0)
+
+        elostats = filter(elo_eligible, pgstats)
 
         # only process elos for elo-eligible players
-        for pgstat in filter(elo_eligible, pgstats):
+        for pgstat in elostats:
             self.wip[pgstat.player_id] = EloWIP(pgstat.player_id, pgstat)
 
         # determine duration from the maximum alivetime
index 74e2d3c0e6a05c1206449d2203c1ec7b9c94e24d..8e39017cf7024cc01318d9614f3849b1707e6fbb 100644 (file)
@@ -1,3 +1,4 @@
+import calendar
 import datetime
 import logging
 import re
@@ -958,7 +959,7 @@ def submit_stats(request):
         request.response.content_type = 'text/plain'
 
         return {
-                "now"        : timegm(datetime.datetime.utcnow().timetuple()),
+                "now"        : calendar.timegm(datetime.datetime.utcnow().timetuple()),
                 "server"     : server,
                 "game"       : game,
                 "gmap"       : gmap,