summaryrefslogtreecommitdiff
path: root/wk9/lect/froshims/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'wk9/lect/froshims/app.py')
-rw-r--r--wk9/lect/froshims/app.py8
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")