diff --git a/app/routes.py b/app/routes.py index 4709a14..1c4b560 100644 --- a/app/routes.py +++ b/app/routes.py @@ -66,7 +66,9 @@ def create_game(): @app.route('/game//dashboard') @login_required def game_dashboard(game_name): - game = Game.query.filter(Game.game_players.any(and_(GamePlayer.player.has(Player.name == current_user.name), GamePlayer.role == 'owner'))).first_or_404() + #game = Game.query.filter(Game.game_players.any(and_(GamePlayer.player.has(Player.name == current_user.name), GamePlayer.role == 'owner'))).first_or_404() + game = Game.query.filter_by(name = game_name).first_or_404() + if not is_game_owner(game): abort(403) return render_template('game_dashboard.html', title = 'Game Dashboard', game=game, json=json, encoder=ObjectiveMinimalEncoder) @app.route('/game//player/')