Skip to content

fix: normalise email to lowercase and prevent duplicate accounts - #609

Open
0x5t4l1n wants to merge 1 commit into
compserv:masterfrom
0x5t4l1n:fix/case-insensitive-email-dedup
Open

fix: normalise email to lowercase and prevent duplicate accounts#609
0x5t4l1n wants to merge 1 commit into
compserv:masterfrom
0x5t4l1n:fix/case-insensitive-email-dedup

Conversation

@0x5t4l1n

@0x5t4l1n 0x5t4l1n commented Aug 2, 2026

Copy link
Copy Markdown

Summary\n\nFixes #500 — account creation was case-sensitive, allowing User@Berkeley.EDU and user@berkeley.edu to create two separate accounts.\n\nChanges in hknweb/forms.py:\n- Lowercase the email in clean_email() before the domain check\n- Raise ValidationError with code duplicate when an account with that address already exists\n\n## Test plan\n- [ ] Register with Test@Berkeley.EDU — should succeed\n- [ ] Register again with test@berkeley.edu — should show duplicate error\n- [ ] Register with TEST@BERKELEY.EDU — same duplicate error\n\n🤖 Generated with Claude Code

Resolves compserv#500. Account creation was case-sensitive: User@Berkeley.EDU
and user@berkeley.edu would both pass validation and create two separate
accounts. Fix by lowercasing the email in clean_email() before the
domain check, and raising ValidationError when an account with that
address (case-insensitive) already exists.
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.

1 participant