Skip to content

Commit 1abf493

Browse files
committed
✨ feat(app): update app.py with new changes
1 parent 4889525 commit 1abf493

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def signup_for_activity(activity_name: str, email: str):
6262
# Get the specific activity
6363
activity = activities[activity_name]
6464

65+
# Validate student is not already signed up
66+
if email in activity["participants"]:
67+
raise HTTPException(status_code=400, detail="Student already signed up for this activity")
68+
6569
# Add student
6670
activity["participants"].append(email)
6771
return {"message": f"Signed up {email} for {activity_name}"}

0 commit comments

Comments
 (0)