forked from OpenClassrooms-Student-Center/Python_Testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Given
A secretary attempts to log in to the application
When
They enter an email address that does not exist in clubs.json
Then (actual behavior)
The application crashes with an IndexError 500 — [0] is called on an empty list
Expected behavior
The error is caught and handled gracefully. The user sees a message: "Sorry, that email wasn't found." Valid emails continue to redirect to the showSummary page as normal.
Relevant code / route
showSummary() in server.py
club = [club for club in clubs if club['email'] == request.form['email']][0]
Branch name
fix/login-unknown-email-crash
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working