Skip to content

ERROR: Entering an unknown email crashes the app #2

@SiRipo92

Description

@SiRipo92

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions