From 6306f6694265432e78cace77e679e3f813048c2a Mon Sep 17 00:00:00 2001 From: Burathar Date: Fri, 10 Jul 2020 13:04:07 +0200 Subject: [PATCH] fix game_dashboard route, wrong game was shown --- app/routes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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/')