diff --git a/.gitignore b/.gitignore index 2cba99d87..6c234efec 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ lib .Python tests/ .envrc -__pycache__ \ No newline at end of file +__pycache__ +.idea/ \ No newline at end of file diff --git a/server.py b/server.py index 4084baeac..83785a34f 100644 --- a/server.py +++ b/server.py @@ -26,7 +26,13 @@ def index(): @app.route('/showSummary',methods=['POST']) def showSummary(): - club = [club for club in clubs if club['email'] == request.form['email']][0] + + club = next((club for club in clubs if club['email'] == request.form['email']), None) + + if club is None: + flash("Sorry, that email wasn't found.") + return render_template("index.html", error="Email not found"), 404 + return render_template('welcome.html',club=club,competitions=competitions) diff --git a/templates/index.html b/templates/index.html index 926526b7d..56b19b23c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,6 +6,17 @@

Welcome to the GUDLFT Registration Portal!

+ + {% with messages = get_flashed_messages()%} + {% if messages %} + + {% endif%} + {%endwith%} + Please enter your secretary email to continue: