diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 10:00:10 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 10:00:10 +0000 |
commit | 66485a40fb0e7a3905241c1fcfe10a6feef51a3b (patch) | |
tree | 7e1c1ef5875e8fcb74d507fa1efe5d2f2f51ed38 /wk9/lect/froshims/app.py | |
parent | 6583298b160057ccecd7720ee663a90d3ec2921a (diff) |
Tue, Jul 9, 2024, 3:00 AM -07:00
Diffstat (limited to 'wk9/lect/froshims/app.py')
-rw-r--r-- | wk9/lect/froshims/app.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wk9/lect/froshims/app.py b/wk9/lect/froshims/app.py index 5d64a54..a60a291 100644 --- a/wk9/lect/froshims/app.py +++ b/wk9/lect/froshims/app.py @@ -2,13 +2,15 @@ from flask import Flask, render_template, request app = Flask(__name__) +SPORTS = ["Basketball", "Soccer", "Ultimate Frisbee"] + + @app.route("/") def index(): - return render_template("index.html") + return render_template("index.html", sports=SPORTS) @app.route("/register", methods=["POST"]) def register(): - - if not request.form.get("name") or not request.form.get("sport"): + if not request.form.get("name") or request.form.get("sport") not in SPORTS: return render_template("failure.html") return render_template("success.html") |