Skip to content

Add email validation for empty and whitespace-only values#5

Merged
pmca31 merged 4 commits intoaccelerate-with-copilotfrom
copilot/sub-pr-2-another-one
Feb 10, 2026
Merged

Add email validation for empty and whitespace-only values#5
pmca31 merged 4 commits intoaccelerate-with-copilotfrom
copilot/sub-pr-2-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Addresses missing input validation on email parameters in the signup and unregister endpoints.

Changes

  • Input validation: Added if not email.strip() checks to reject empty or whitespace-only emails in both /activities/{activity_name}/signup and /activities/{activity_name}/unregister endpoints
  • Error handling: Returns 400 Bad Request with message "Email cannot be empty or whitespace-only"
  • Test coverage: Added 4 test cases covering empty and whitespace-only email validation for both endpoints
@app.post("/activities/{activity_name}/signup")
def signup_for_activity(activity_name: str, email: str):
    """Sign up a student for an activity"""
    # Validate email is not empty or whitespace-only
    if not email.strip():
        raise HTTPException(status_code=400, detail="Email cannot be empty or whitespace-only")
    
    # ... rest of validation

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 10, 2026 17:00
Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on "Accelerate with copilot" PR Add email validation for empty and whitespace-only values Feb 10, 2026
Copilot AI requested a review from pmca31 February 10, 2026 17:03
@pmca31 pmca31 marked this pull request as ready for review February 10, 2026 17:08
@pmca31 pmca31 merged commit 450fba0 into accelerate-with-copilot Feb 10, 2026
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