Skip to content

Conversation

@elof-dev
Copy link

Summary

This pull request fixes Issue #1 – the application crashed when entering an unknown email on the login page.

Context

The function showSummary() in server.py did not properly handle invalid or unknown emails.
This caused the app to fail instead of displaying an appropriate flash message to the user.

Changes Made

  • server.py → fixed the showSummary() logic to handle email validation and unknown users
  • index.html → added a flash message section to display user feedback
  • tests/ → created:
    • conftest.py for Flask test configuration
    • test_show_summary.py to test showSummary() behavior with valid/invalid emails
  • .flaskenv → added for local environment configuration
  • .gitignore → now ignores .venv and keeps tests/ included
  • requirements.txt → added pytest dependency

Testing

  • 3 tests created and executed successfully using pytest
  • Verified status code and message in the browser for:
    • valid email
    • unknown email
    • no email

Linked Issue

Fixes #1

- Updated showSummary() in server.py to handle email validation and error messages
- Modified index.html to display flash messages correctly
- Created tests/ folder with conftest.py and test_show_summary.py for unit testing
- Added .flaskenv for local environment configuration
- Updated .gitignore to include .venv and exclude tests/ folder
- Updated requirements.txt to add pytest dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: Entering a unknown email crashes the app

1 participant