aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py40
1 files changed, 8 insertions, 32 deletions
diff --git a/app.py b/app.py
index c4e4d89..6c1609a 100644
--- a/app.py
+++ b/app.py
@@ -26,38 +26,26 @@ def home():
def get_random_games():
print("Creating new games...")
GAME_GENERATOR.create_random_games(COURT_LIST, PLAYER_LIST)
- return render_template(
- "games.j2",
- games=GAME_GENERATOR.games,
- )
+ return render_template("games.j2", games=GAME_GENERATOR.games)
@app.route("/skilled-games", methods=["POST"])
def get_skilled_games():
print("Creating new games...")
GAME_GENERATOR.create_skilled_games(COURT_LIST, PLAYER_LIST)
- return render_template(
- "games.j2",
- games=GAME_GENERATOR.games,
- )
+ return render_template("games.j2", games=GAME_GENERATOR.games)
@app.route("/clear-games", methods=["POST"])
def clear_games():
print("Clearing games...")
GAME_GENERATOR.clear(COURT_LIST)
- return render_template(
- "games.j2",
- games=GAME_GENERATOR.games,
- )
+ return render_template("games.j2", games=GAME_GENERATOR.games)
@app.route("/game-list", methods=["GET"])
def get_list_of_games():
- return render_template(
- "games.j2",
- games=GAME_GENERATOR.games,
- )
+ return render_template("games.j2", games=GAME_GENERATOR.games)
@app.route("/player-toggle/<player_request>", methods=["POST"])
@@ -67,18 +55,12 @@ def toggle_player(player_request):
abort(404)
PLAYER_LIST.toggle_player(player_request)
selection = PLAYER_LIST.get_player(player_request)
- return render_template(
- "player.j2",
- player=selection[0],
- )
+ return render_template("player.j2", player=selection[0])
@app.route("/player-list", methods=["GET"])
def get_list_of_players():
- return render_template(
- "players.j2",
- players=PLAYER_LIST.players,
- )
+ return render_template("players.j2", players=PLAYER_LIST.players)
@app.route("/court-toggle/<court_number>", methods=["POST"])
@@ -89,15 +71,9 @@ def toggle_court(court_number):
abort(404, f"Multiple courts requested: {len(selection)}")
COURT_LIST.toggle_court(court_number)
selection = COURT_LIST.get_court(court_number)
- return render_template(
- "court.j2",
- court=selection[0],
- )
+ return render_template("court.j2", court=selection[0])
@app.route("/court-list", methods=["GET"])
def get_list_of_courts():
- return render_template(
- "courts.j2",
- courts=COURT_LIST.courts,
- )
+ return render_template("courts.j2", courts=COURT_LIST.courts)