3838 "schedule" : "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM" ,
3939 "max_participants" : 30 ,
404041+ },
42+ "Soccer Team" : {
43+ "description" : "Competitive soccer team training and matches" ,
44+ "schedule" : "Monday, Wednesday, Friday, 4:00 PM - 6:00 PM" ,
45+ "max_participants" : 22 ,
46+ 47+ },
48+ "Basketball Club" : {
49+ "description" : "Pickup games, drills, and intramural tournaments" ,
50+ "schedule" : "Tuesdays and Thursdays, 5:00 PM - 7:00 PM" ,
51+ "max_participants" : 15 ,
52+ 53+ },
54+ "Art Club" : {
55+ "description" : "Explore drawing, painting, and mixed media projects" ,
56+ "schedule" : "Wednesdays, 3:30 PM - 5:00 PM" ,
57+ "max_participants" : 18 ,
58+ 59+ },
60+ "Drama Club" : {
61+ "description" : "Acting workshops, rehearsals, and stage productions" ,
62+ "schedule" : "Thursdays, 4:00 PM - 6:30 PM" ,
63+ "max_participants" : 25 ,
64+ 65+ },
66+ "Debate Team" : {
67+ "description" : "Practice public speaking, research, and competitive debates" ,
68+ "schedule" : "Mondays and Thursdays, 4:00 PM - 5:30 PM" ,
69+ "max_participants" : 16 ,
70+ 71+ },
72+ "Math Club" : {
73+ "description" : "Problem-solving sessions and preparation for math competitions" ,
74+ "schedule" : "Fridays, 3:30 PM - 4:30 PM" ,
75+ "max_participants" : 20 ,
76+ 4177 }
4278}
4379
@@ -62,6 +98,10 @@ def signup_for_activity(activity_name: str, email: str):
6298 # Get the specific activity
6399 activity = activities [activity_name ]
64100
101+ # Validate student is not already signed up
102+ if email in activity ["participants" ]:
103+ raise HTTPException (status_code = 400 , detail = "Student already signed up for this activity" )
104+
65105 # Add student
66106 activity ["participants" ].append (email )
67107 return {"message" : f"Signed up { email } for { activity_name } " }
0 commit comments