diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-16 11:25:08 +0200 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-16 11:25:08 +0200 |
| commit | 67e6c6344e2828bcda8700e44da3ff5c96bc035b (patch) | |
| tree | 8732199f7124e37c068535071707d160b7de153c /app.py | |
| parent | d304a470e5a9fae6fc0c8975f050cb7aa290f74a (diff) | |
Cleaned up the code to generate test data
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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"]) |
