generated from skills/getting-started-with-github-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Accelerate with copilot #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,42 @@ | |
| "schedule": "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM", | ||
| "max_participants": 30, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Soccer Team": { | ||
| "description": "Join the school soccer team and compete in matches", | ||
| "schedule": "Tuesdays and Thursdays, 4:00 PM - 5:30 PM", | ||
| "max_participants": 22, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Basketball Team": { | ||
| "description": "Practice and compete in basketball games", | ||
| "schedule": "Wednesdays and Fridays, 3:30 PM - 5:00 PM", | ||
| "max_participants": 15, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Art Club": { | ||
| "description": "Explore various art techniques and create projects", | ||
| "schedule": "Thursdays, 3:30 PM - 5:00 PM", | ||
| "max_participants": 15, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Drama Club": { | ||
| "description": "Participate in plays and improve acting skills", | ||
| "schedule": "Mondays and Wednesdays, 4:00 PM - 5:30 PM", | ||
| "max_participants": 20, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Math Club": { | ||
| "description": "Solve challenging math problems and compete in math contests", | ||
| "schedule": "Tuesdays, 3:30 PM - 4:30 PM", | ||
| "max_participants": 10, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| }, | ||
| "Debate Team": { | ||
| "description": "Develop public speaking and argumentation skills", | ||
| "schedule": "Fridays, 4:00 PM - 5:30 PM", | ||
| "max_participants": 12, | ||
| "participants": ["[email protected]", "[email protected]"] | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -62,6 +98,10 @@ def signup_for_activity(activity_name: str, email: str): | |
| # Get the specificy activity | ||
| activity = activities[activity_name] | ||
|
|
||
| # Validate student is not already signed up | ||
| if email in activity["participants"]: | ||
| raise HTTPException(status_code=400, detail="Already signed up for this activity") | ||
|
|
||
| # Add student | ||
| activity["participants"].append(email) | ||
| return {"message": f"Signed up {email} for {activity_name}"} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider normalizing email addresses (e.g., converting them to lowercase) before checking for duplicates to ensure consistency.