Improve student activity registration system#4
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request enhances the student activity registration system by adding new activity options, implementing participant management features (including unregistration), improving the UI with participant visibility, and adding comprehensive API test coverage.
- Expanded the activities catalog with 6 new options across sports, arts, and intellectual categories
- Implemented duplicate signup prevention and participant unregistration functionality
- Enhanced the frontend to display participant lists with inline delete functionality
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/app.py | Added 6 new activities, implemented duplicate signup validation, and added unregister endpoint |
| src/static/app.js | Added participant list display with delete icons and error handling for unregistration |
| src/static/styles.css | Added styling for participant sections, delete icons, and activity card shadows |
| tests/test_app.py | Added comprehensive test suite covering all API endpoints including edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| # Unregister a participant from an activity | ||
| from fastapi import Query |
There was a problem hiding this comment.
The import statement for Query should be moved to the top of the file with other imports. Having imports in the middle of the file violates Python conventions and can make the code harder to maintain.
| # Get the specific activity | ||
| activity = activities[activity_name] | ||
|
|
||
| # Validate student is not already signed up |
There was a problem hiding this comment.
The comment has incorrect indentation - it should align with the code it describes rather than being outdented to column 0.
| # Validate student is not already signed up | |
| # Validate student is not already signed up |
This pull request adds new features and improvements to the school activities app, including support for more activities, participant management (signup and unregister), UI enhancements, and comprehensive API tests. The most important changes are grouped below.
Backend features and validation:
activitiesdictionary insrc/app.py, including sports, artistic, and intellectual options such as Soccer Team, Basketball Club, Art Workshop, Drama Club, Math Olympiad, and Science Club.src/app.py.Frontend UI enhancements:
src/static/app.jsto display participants for each activity, including an option to unregister via a delete icon, with error handling and UI feedback.src/static/styles.cssfor the participants section, delete icon, and improved activity card appearance. [1] [2]Testing:
tests/test_app.pyfor all main API endpoints, including getting activities, signing up, duplicate signup prevention, unregistering, error cases, and activity not found.