Skip to content

Improve student activity registration system#2

Merged
Pollodiabolo merged 4 commits into
mainfrom
accelerate-with-copilot
Feb 24, 2026
Merged

Improve student activity registration system#2
Pollodiabolo merged 4 commits into
mainfrom
accelerate-with-copilot

Conversation

@Pollodiabolo

@Pollodiabolo Pollodiabolo commented Feb 24, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several enhancements to the activities management system, focusing on expanding available activities, improving participant management (including the ability to remove participants), updating the frontend to reflect these changes, and adding comprehensive tests. These changes collectively improve both user experience and code reliability.

Backend enhancements:

  • Added several new activities to the activities data structure in src/app.py, each with its own description, schedule, participant capacity, and initial participants.
  • Implemented a new API endpoint (DELETE /activities/{activity_name}/participants) to allow removal of a participant from an activity, with appropriate error handling if the participant or activity does not exist. Also added a check to prevent duplicate signups in the signup endpoint.

Frontend improvements:

  • Updated the UI in src/static/app.js to display participants for each activity, including a delete button next to each participant for easy removal. The participants list is now styled for clarity, and activity selection is reset on refresh to avoid duplicate options. [1] [2]
  • Added client-side logic to handle participant removal via the new API endpoint, with success/error feedback and automatic UI refresh. Also ensured the participants list updates after signups. [1] [2]

Testing and code quality:

  • Introduced a pytest fixture in tests/conftest.py to ensure the in-memory activities data is restored after each test, maintaining test isolation.
  • Added new tests in tests/test_activities.py to cover activity retrieval, successful and duplicate signups, and participant removal (both successful and not found scenarios).

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

This PR enhances the student activities system by expanding the in-memory activity catalog, preventing duplicate signups, adding participant removal support end-to-end (API + UI), and introducing pytest coverage to validate the new behaviors.

Changes:

  • Expanded the activities dataset and added backend logic for duplicate signup prevention plus a new participant-removal endpoint.
  • Updated the frontend to render participants per activity and allow removing participants via a delete button.
  • Added pytest fixtures and tests to ensure isolation and cover GET, signup (including duplicates), and removal flows.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/app.py Adds new activities, prevents duplicate signups, and introduces DELETE /activities/{activity_name}/participants.
src/static/app.js Renders participants and wires up delete-participant behavior; refreshes UI after signup/removal.
src/static/styles.css Adds styling for participant lists and delete buttons.
tests/conftest.py Introduces a fixture that snapshots/restores the in-memory activities dict per test.
tests/test_activities.py Adds tests for activity retrieval, successful/duplicate signup, and participant removal scenarios.
requirements.txt Adds test/dependency entries needed for running the new test suite.

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

Comment thread src/static/app.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Pollodiabolo Pollodiabolo merged commit ab3edfa into main Feb 24, 2026
@Pollodiabolo Pollodiabolo deleted the accelerate-with-copilot branch February 24, 2026 14:31
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