diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 09:51:40 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 09:51:40 +0000 |
commit | 52f3ef360087fb26575cf1ba0a65ab56d2d84ca2 (patch) | |
tree | dd091e4f18ea911cacb78b86dc06d8fb78216df5 | |
parent | 1d7aa03ad1e770bcfa37ea40a572bab272d56ffc (diff) |
Tue, Jul 9, 2024, 2:51 AM -07:00
-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") |