Skip to content

Fix duplicate student registration bug and add 6 new extracurricular activities#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1
Draft

Fix duplicate student registration bug and add 6 new extracurricular activities#2
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1

Conversation

Copy link
Copy Markdown

Copilot AI commented Aug 26, 2025

This PR addresses the duplicate registration bug in the Mergington High School Activities system and expands the available extracurricular activities as part of the GitHub Copilot exercise.

Bug Fix: Duplicate Registration Prevention

The original signup_for_activity function allowed students to register multiple times for the same activity, creating duplicate entries in the participants list. This has been fixed by adding validation:

# Validate student is not already signed up
if email in activity["participants"]:
    raise HTTPException(status_code=400, detail="Student is already signed up")

Before: Students could register multiple times, creating duplicates like:

"participants": ["student@mergington.edu", "student@mergington.edu"]

After: Duplicate registrations return HTTP 400 with clear error message.

New Activities Added

Expanded the activities database from 3 to 9 activities, adding variety across different interest areas:

Sports Activities (2 new)

  • Basketball Team - Competitive basketball training and games
  • Swimming Club - Swimming training and water sports

Artistic Activities (2 new)

  • Art Studio - Express creativity through painting and drawing
  • Drama Club - Theater arts and performance training

Intellectual Activities (2 new)

  • Debate Team - Learn public speaking and argumentation skills
  • Science Club - Hands-on experiments and scientific exploration

All new activities include realistic schedules, participant limits, and empty participant lists ready for signups.

Testing

  • ✅ Duplicate registration prevention works via both API and web interface
  • ✅ All 9 activities display correctly in the web interface
  • ✅ New activities accept signups successfully
  • ✅ Application runs without errors

Fixes #1.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Copy Markdown
Author

Copilot AI commented Aug 26, 2025

@heathermathies-accesso 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

- Add validation to prevent students from registering twice for same activity
- Add 2 sports activities: Basketball Team, Swimming Club
- Add 2 artistic activities: Art Studio, Drama Club
- Add 2 intellectual activities: Debate Team, Science Club
- All activities include realistic schedules and participant limits
- Tested duplicate registration prevention via web interface

Co-authored-by: heathermathies-accesso <114941769+heathermathies-accesso@users.noreply.github.com>
Copilot AI changed the title [WIP] Exercise: Getting Started with GitHub Copilot Fix duplicate student registration bug and add 6 new extracurricular activities Aug 26, 2025
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.

Exercise: Getting Started with GitHub Copilot

2 participants