From a50d1946ced67eaa9068d44f8c1a825efe57809d Mon Sep 17 00:00:00 2001 From: yann Date: Fri, 20 Jun 2025 12:13:50 +0200 Subject: [PATCH] fixed list, handled wrong email case, adjusted template --- server.py | 10 ++++++---- templates/index.html | 12 +++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index 4084bae..4112082 100644 --- a/server.py +++ b/server.py @@ -26,9 +26,11 @@ def index(): @app.route('/showSummary',methods=['POST']) def showSummary(): - club = [club for club in clubs if club['email'] == request.form['email']][0] - return render_template('welcome.html',club=club,competitions=competitions) - + club = [club for club in clubs if club['email'] == request.form['email']] + if club: + return render_template('welcome.html', club=club[0], competitions=competitions) + flash("The email isn't found") + return redirect(url_for('index')) @app.route('/book//') def book(competition,club): @@ -56,4 +58,4 @@ def purchasePlaces(): @app.route('/logout') def logout(): - return redirect(url_for('index')) \ No newline at end of file + return redirect(url_for('index')) diff --git a/templates/index.html b/templates/index.html index 926526b..5bd9351 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,6 +6,16 @@

Welcome to the GUDLFT Registration Portal!

+ {% with messages = get_flashed_messages()%} + {% if messages %} +
    + {% for message in messages %} +
  • {{message}}
  • + {% endfor %} +
+ {% endif%} + {% endwith %} + Please enter your secretary email to continue:
@@ -13,4 +23,4 @@
- \ No newline at end of file +