From 67e6c6344e2828bcda8700e44da3ff5c96bc035b Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Wed, 16 Oct 2024 11:25:08 +0200 Subject: Cleaned up the code to generate test data --- app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index 87151fe..a81bde0 100644 --- a/app.py +++ b/app.py @@ -8,11 +8,9 @@ from flask import Flask, render_template, request load_dotenv() -rg = RoundGenerator(courts=CourtList(12), players=PlayerList("test_data_large.csv")) - - app = Flask("Match Up! Backend") app.config.from_object(getenv("PROD_APP_SETTINGS", "config.DevelopmentConfig")) +rg = RoundGenerator(courts=CourtList(12), players=PlayerList("test_data_large.csv")) @app.route("/", methods=["GET"]) @@ -28,7 +26,8 @@ def get_random_games(): @app.route("/confirm", methods=["POST"]) def confirm_games(): - return render_template("games.j2", title=f"Round: {rg.round}", games=rg.confirm()) + games = rg.confirm() + return render_template("games.j2", title=f"Round: {rg.round}", games=games) @app.route("/clear", methods=["POST"]) -- cgit v1.3.1