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

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

Fixes #500 — account creation was case-sensitive, allowing User@Berkeley.EDU and user@berkeley.edu to create two separate accounts.

Changes in hknweb/forms.py:

  • Lowercase the email in clean_email() before the domain check
  • Raise ValidationError with code duplicate when an account with that address already exists

Test plan

  • Register with Test@Berkeley.EDU — should succeed
  • Register again with test@berkeley.edu — should show duplicate error
  • Register with TEST@BERKELEY.EDU — same duplicate error

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.

This branch has not been deployed

No deployments
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.

Candidate account creation is case sensitive and fails on duplicate emails

1 participant