Skip to content

Commit a7db9ee

Browse files
committed
Require logins to be all-lowercase. This was prompted by repeated
trouble with people registering non-lowercase logins, then trying to log in with all-lowercase, or vice versa. - Legacy-Id: 6472
1 parent d649fd5 commit a7db9ee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/ietfauth/forms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class RegistrationForm(forms.Form):
1717

18-
email = forms.EmailField(label="Your email")
18+
email = forms.EmailField(label="Your email (lowercase)")
1919
realm = 'IETF'
2020
expire = 3
2121

@@ -45,6 +45,8 @@ def clean_email(self):
4545
email = self.cleaned_data.get('email', '')
4646
if not email:
4747
return email
48+
if email.lower() != email:
49+
raise forms.ValidationError(_('The supplied address contained uppercase letters. Please use a lowercase email address.'))
4850
if User.objects.filter(username=email).count():
4951
raise forms.ValidationError(_('An account with the email address you provided already exists.'))
5052
return email

0 commit comments

Comments
 (0)