From: Ant Zucaro Date: Sun, 25 Aug 2013 21:00:01 +0000 (-0400) Subject: Add back the /player/me view. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=45b13d7a92cbf932d35fec80ca47cc4ca55e0de6;p=xonotic%2Fxonstat.git Add back the /player/me view. --- diff --git a/xonstat/__init__.py b/xonstat/__init__.py index b60c35b..85f1030 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -51,8 +51,7 @@ def main(global_config, **settings): config.add_route("player_hashkey_info_json", "/player/{hashkey:.{44}}.json") config.add_view(player_hashkey_info_json, route_name="player_hashkey_info_json", renderer="jsonp") - #config.add_route("player_hashkey_info_text", "/player/me") - config.add_route("player_hashkey_info_text", "/player/{hashkey}") + config.add_route("player_hashkey_info_text", "/player/me") config.add_view(player_hashkey_info_text, route_name="player_hashkey_info_text", renderer="player_hashkey_info_text.mako") config.add_route("player_info_json", "/player/{id:\d+}.json") diff --git a/xonstat/views/player.py b/xonstat/views/player.py index a1945cc..d684702 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -788,10 +788,7 @@ def player_damage_json(request): def player_hashkey_info_data(request): - #(idfp, status) = verify_request(request) - #print "player_hashkey_info_data [idfp={0} status={1}]".format(idfp, status) - - hashkey = request.matchdict['hashkey'] + (idfp, status) = verify_request(request) # if config is to *not* verify requests and we get nothing back, this # query will return nothing and we'll 404. @@ -799,7 +796,7 @@ def player_hashkey_info_data(request): player = DBSession.query(Player).\ filter(Player.player_id == Hashkey.player_id).\ filter(Player.active_ind == True).\ - filter(Hashkey.hashkey == hashkey).one() + filter(Hashkey.hashkey == idfp).one() games_played = get_games_played(player.player_id) overall_stats = get_overall_stats(player.player_id)