config.add_route("game_info_json", "/game/{id:\d+}.json")
config.add_view(game_info_json, route_name="game_info_json", renderer="jsonp")
- config.add_route("rank_index", "/ranks/{game_type_cd:ctf|dm|tdm|duel|ca|ft}")
+ config.add_route("rank_index", "/ranks/{game_type_cd}")
config.add_view(rank_index, route_name="rank_index", renderer="rank_index.mako")
- config.add_route("rank_index_json", "/ranks/{game_type_cd:ctf|dm|tdm|duel|ca|ft}.json")
+ config.add_route("rank_index_json", "/ranks/{game_type_cd}.json")
config.add_view(rank_index_json, route_name="rank_index_json", renderer="jsonp")
config.add_route("game_index", "/games")
else:
current_page = 1
+ # game type whitelist
+ game_types_allowed = ["ca", "ctf", "dm", "duel", "ft", "ka", "tdm"]
+
game_type_cd = request.matchdict['game_type_cd']
+ if game_type_cd not in game_types_allowed:
+ raise httpexceptions.HTTPNotFound()
ranks_q = DBSession.query(PlayerRank).\
filter(PlayerRank.game_type_cd==game_type_cd).\