config.add_route("player_game_index_json", "/player/{player_id:\d+}/games.json")
config.add_view(player_game_index_json, route_name="player_game_index_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", "/player/{id:\d+}")
def player_hashkey_info_data(request):
(idfp, status) = verify_request(request)
- print "player_hashkey_info_data [idfp={0} status={1}]".format(idfp, status)
+ log.debug("d0_blind_id verification: idfp={0} status={1}\n".format(idfp, status))
- hashkey = request.matchdict['hashkey']
+ log.debug("\n----- BEGIN REQUEST BODY -----\n" + request.body +
+ "----- END REQUEST BODY -----\n\n")
# if config is to *not* verify requests and we get nothing back, this
# query will return nothing and we'll 404.
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)
raise pyramid.httpexceptions.HTTPNotFound
return {'player':player,
- 'hashkey':hashkey,
+ 'hashkey':idfp,
'games_played':games_played,
'overall_stats':overall_stats,
'fav_maps':fav_maps,
"""
Provides elo information on a specific player. Raw data is returned.
"""
+ (idfp, status) = verify_request(request)
+ log.debug("d0_blind_id verification: idfp={0} status={1}\n".format(idfp, status))
+
hashkey = request.matchdict['hashkey']
- print "player_elo_info_data [hashkey={0}]".format(hashkey)
+ log.debug("\n----- BEGIN REQUEST BODY -----\n" + request.body +
+ "----- END REQUEST BODY -----\n\n")
+
try:
player = DBSession.query(Player).\
filter(Player.player_id == Hashkey.player_id).\