|
|
@ -66,7 +66,9 @@ def create_game(): |
|
|
|
@app.route('/game/<game_name>/dashboard') |
|
|
|
@app.route('/game/<game_name>/dashboard') |
|
|
|
@login_required |
|
|
|
@login_required |
|
|
|
def game_dashboard(game_name): |
|
|
|
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) |
|
|
|
return render_template('game_dashboard.html', title = 'Game Dashboard', game=game, json=json, encoder=ObjectiveMinimalEncoder) |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/game/<game_name>/player/<player_name>') |
|
|
|
@app.route('/game/<game_name>/player/<player_name>') |
|
|
|