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 5f6cba2..26da28f 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)
 
     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,
 
     return [{
         'player':           player,
@@ -577,7 +575,6 @@ def player_info_json(request):
         'ranks':            ranks,
         'recent_games':     recent_games,
     }]
         'ranks':            ranks,
         'recent_games':     recent_games,
     }]
-    #return [{'status':'not implemented'}]
 
 
 def player_game_index_data(request):
 
 
 def player_game_index_data(request):