Skip to content

Improve student activity registration system - #2

Merged
Christine8605 merged 6 commits into
mainfrom
accelerate-with-copilot
Apr 15, 2026
Merged

Improve student activity registration system#2
Christine8605 merged 6 commits into
mainfrom
accelerate-with-copilot

Conversation

@Christine8605

Copy link
Copy Markdown
Owner

This pull request adds support for unregistering students from activities, improves the display of participants in the UI, and introduces comprehensive backend tests to ensure the reliability of signup and unregister features. It also expands the list of available activities.

Backend functionality and validation:

  • Added a DELETE /activities/{activity_name}/signup endpoint to allow students to unregister from activities, with appropriate error handling for missing activities or students not registered.
  • Improved signup validation to prevent duplicate registrations by raising an error if a student is already signed up.

Frontend UI improvements:

  • Updated the activities list to display all participants for each activity, including an "unregister" (delete) button next to each participant. [1] [2]
  • Implemented frontend logic to handle unregistering participants via the new API endpoint, refreshing the activities list upon success. [1] [2]

Testing:

  • Added a comprehensive test suite (tests/test_app.py) covering activity listing, signup, and unregister endpoints, including edge cases and isolation between tests.

Data updates:

  • Added several new activities with sample participants to the in-memory data store, such as Basketball Team, Tennis Club, Art Class, Music Band, Debate Club, and Science Club.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds unregister support for student activity signups end-to-end (backend API + frontend UI) and introduces backend tests to cover core signup/unregister flows.

Changes:

  • Backend: add DELETE /activities/{activity_name}/signup and prevent duplicate signups.
  • Frontend: render participant lists per activity and allow unregistering via a delete button; refresh UI after changes.
  • Testing/data: add pytest suite for activities endpoints and expand seeded activities.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/app.py Adds unregister endpoint, duplicate-signup validation, and expands seeded activities.
src/static/app.js Renders participants + unregister buttons and triggers refresh after signup/unregister.
src/static/styles.css Styles participant list and delete/unregister button.
tests/test_app.py Adds pytest coverage for listing, signup, duplicate signup, and unregister scenarios with isolation.
requirements.txt Adds pytest dependency and fixes line formatting for watchfiles.
tests/__init__.py Marks tests as a package (no functional changes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/static/app.js
Comment on lines 74 to 79
if (response.ok) {
messageDiv.textContent = result.message;
messageDiv.className = "success";
signupForm.reset();
fetchActivities();
} else {

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

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

fetchActivities() repopulates the <select id="activity"> by appending options but never clears existing options. Now that fetchActivities() is called after signup/unregister, the dropdown will accumulate duplicate activity options on every refresh. Clear/reset the select (preserving the placeholder option) before appending new options, or rebuild options from scratch each fetch.

Copilot uses AI. Check for mistakes.
Comment thread src/static/app.js Outdated
Comment thread src/static/app.js Outdated
Comment thread src/static/styles.css
Christine8605 and others added 3 commits April 15, 2026 11:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Christine8605
Christine8605 merged commit c9d4cf4 into main Apr 15, 2026
@Christine8605
Christine8605 deleted the accelerate-with-copilot branch April 15, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants