diff options
-rw-r--r-- | failure.html | 7 | ||||
-rw-r--r-- | success.html | 7 | ||||
-rw-r--r-- | wk9/lect/froshims/app.py | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/failure.html b/failure.html new file mode 100644 index 0000000..f1322c1 --- /dev/null +++ b/failure.html @@ -0,0 +1,7 @@ +{% extends "layout.html" %} + +{% block body %} + + You are not registered! + +{% endblock %} diff --git a/success.html b/success.html new file mode 100644 index 0000000..b79e45b --- /dev/null +++ b/success.html @@ -0,0 +1,7 @@ +{% extends "layout.html" %} + +{% block body %} + + You are registered! (Not really) + +{% endblock %} diff --git a/wk9/lect/froshims/app.py b/wk9/lect/froshims/app.py index 1b34ba2..db24ea6 100644 --- a/wk9/lect/froshims/app.py +++ b/wk9/lect/froshims/app.py @@ -9,6 +9,6 @@ def index(): @app.route("/register", methods=["POST"]) def register(): - if not request.form.get("name") or not request.for.get("sport"): - return "failure" - return "success" + if not request.form.get("name") or not request.form.get("sport"): + return render_template("failure.html") + return render_template("success") |