]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/views/submission.py
Should be ready to go now!
[xonotic/xonstat.git] / xonstat / views / submission.py
index bbdac59ce4cc0c892a75eca12e9e70127b48145d..7f011fbfa4df988a937e1050d3d7acd1c1b70ecc 100755 (executable)
@@ -275,7 +275,7 @@ def create_game(session=None, start_dt=None, game_type_cd=None,
                 filter(Game.match_id==match_id).one()\r
         # if a game under the same server and match_id found, \r
         # this is a duplicate game and can be ignored\r
-        raise pyramid.httpexceptions.HTTPOk\r
+        raise pyramid.httpexceptions.HTTPOk('OK')\r
     except NoResultFound, e:\r
         # server_id/match_id combination not found. game is ok to insert\r
         session.add(game)\r
@@ -605,6 +605,12 @@ def stats_submit(request):
                 create_player_stats(session=session, player=player, game=game, \r
                         player_events=player_events)\r
 \r
+        # update elos\r
+        try:\r
+            game.process_elos(session)\r
+        except Exception as e:\r
+            log.debug('Error (non-fatal): elo processing failed.')\r
+\r
         session.commit()\r
         log.debug('Success! Stats recorded.')\r
         return Response('200 OK')\r