Skip to content

Add registration validation and more activities - #2

Merged
plumass merged 2 commits into
mainfrom
accelerate-with-copilot
Sep 26, 2025
Merged

plumass merged 2 commits into
mainfrom
accelerate-with-copilot

Conversation

@plumass

@plumass plumass commented Sep 26, 2025

Copy link
Copy Markdown
Owner

This pull request adds several new activities to the system, improves the signup logic to prevent duplicate registrations, and enhances the user interface by displaying participant lists for each activity. The changes are organized into backend data/model updates, backend logic improvements, and frontend display enhancements.

Backend data/model updates:

  • Added new activities to the activities dictionary in src/app.py, including sports (Soccer Team, Basketball Club), artistic (Art Workshop, Drama Club), and intellectual (Mathletes, Science Club) activities, each with their own schedule, participant list, and maximum capacity.

Backend logic improvements:

  • Updated the signup_for_activity function in src/app.py to prevent users from signing up for the same activity more than once by checking if the email is already in the participant list and raising an error if so.

Frontend display enhancements:

  • Modified src/static/app.js to show a list of participants for each activity card, including a message when there are no participants yet.
  • Added new CSS styles in src/static/styles.css to visually enhance the participant list section in activity cards, including spacing, colors, and hover effects.

@plumass
plumass requested a review from Copilot September 26, 2025 08:17
@plumass
plumass merged commit f805a33 into main Sep 26, 2025
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances the activity management system by adding new activities, implementing duplicate registration prevention, and displaying participant lists on the frontend. The changes improve both user experience and data integrity by preventing duplicate signups and providing better visibility into activity participation.

  • Added six new activities across sports, artistic, and intellectual categories with predefined participants
  • Implemented backend validation to prevent duplicate registrations for the same activity
  • Enhanced the frontend to display participant lists for each activity with styling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/app.py Added new activities and duplicate registration validation logic
src/static/app.js Updated UI to display participant lists for each activity
src/static/styles.css Added CSS styling for the new participant list display

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/static/app.js
<h5>Participants</h5>
<ul>
${details.participants.length === 0
? '<li><em>Aucun participant pour le moment</em></li>'

Copilot AI Sep 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text 'Aucun participant pour le moment' is in French, which appears inconsistent with the rest of the application that uses English. Consider changing to 'No participants yet' for consistency.

Suggested change
? '<li><em>Aucun participant pour le moment</em></li>'
? '<li><em>No participants yet</em></li>'

Copilot uses AI. Check for mistakes.
Comment thread src/app.py

# Check if already signed up
if email in activity["participants"]:
raise HTTPException(status_code=400, detail="Already signed up for this activity")

Copilot AI Sep 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's trailing whitespace at the end of this line. Consider removing it for cleaner code formatting.

Suggested change
raise HTTPException(status_code=400, detail="Already signed up for this activity")
raise HTTPException(status_code=400, detail="Already signed up for this activity")

Copilot uses AI. Check for mistakes.
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.

2 participants