Browse Source

fix game_dashboard route, wrong game was shown

feature_tests
Burathar 5 years ago
parent
commit
6306f66942
  1. 4
      app/routes.py

4
app/routes.py

@ -66,7 +66,9 @@ def create_game(): @@ -66,7 +66,9 @@ def create_game():
@app.route('/game/<game_name>/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/<game_name>/player/<player_name>')

Loading…
Cancel
Save