We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4889525 commit 1abf493Copy full SHA for 1abf493
src/app.py
@@ -62,6 +62,10 @@ def signup_for_activity(activity_name: str, email: str):
62
# Get the specific activity
63
activity = activities[activity_name]
64
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
+
69
# Add student
70
activity["participants"].append(email)
71
return {"message": f"Signed up {email} for {activity_name}"}
0 commit comments