]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
The player JSON view should use to_dict() instead.
authorAnt Zucaro <azucaro@gmail.com>
Thu, 21 Jan 2016 02:46:22 +0000 (21:46 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Thu, 21 Jan 2016 02:46:22 +0000 (21:46 -0500)
xonstat/views/player.py

index 5f6cba2a422276c0b7aff84a7c74089550a2f615..26da28f9deb3d29732a40ef063a728aeb6c4314d 100644 (file)
@@ -564,9 +564,7 @@ def player_info_json(request):
     for gt,mapinfo in player_info['fav_maps'].items():
         fav_maps[gt] = to_json(mapinfo)
 
-    recent_games = []
-    for game in player_info['recent_games']:
-        recent_games.append(to_json(game))
+    recent_games = [g.to_dict() for g in player_info['recent_games']]
 
     return [{
         'player':           player,
@@ -577,7 +575,6 @@ def player_info_json(request):
         'ranks':            ranks,
         'recent_games':     recent_games,
     }]
-    #return [{'status':'not implemented'}]
 
 
 def player_game_index_data(request):