From 7ba1a440cef979ee1e892e9291946af2e7f0fd3e Mon Sep 17 00:00:00 2001 From: yann Date: Mon, 7 Jul 2025 14:09:59 +0200 Subject: [PATCH] fixed test on mail --- server.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index fa42478..0b82b0b 100644 --- a/server.py +++ b/server.py @@ -29,11 +29,12 @@ def index(): @app.route('/showSummary',methods=['POST']) def showSummary(): - club = [club for club in clubs if club['email'] == request.form['email']] - if club: - return render_template('welcome.html', club=club[0], competitions=competitions, now=now) - flash("Sorry, that email wasn't found") - return redirect(url_for('index')) + try: + club = [club for club in clubs if club['email'] == request.form['email']][0] + return render_template('welcome.html', club=club, competitions=competitions) + except IndexError: + flash("Sorry, that email wasn't found") + return redirect(url_for('index')) @app.route('/book//') def book(competition,club):