diff --git a/zephyr/forms.py b/zephyr/forms.py index c302239b49..94153c5332 100644 --- a/zephyr/forms.py +++ b/zephyr/forms.py @@ -35,10 +35,6 @@ def isnt_mit(value): if "@mit.edu" in value: raise ValidationError(mark_safe(u'Humbug for MIT is by invitation only. ' + SIGNUP_STRING)) - -class UniqueEmailField(forms.EmailField): - default_validators = [validators.validate_email, is_unique] - class RegistrationForm(forms.Form): full_name = forms.CharField(max_length=100) password = forms.CharField(widget=forms.PasswordInput, max_length=100) @@ -50,10 +46,10 @@ class ToSForm(forms.Form): class HomepageForm(forms.Form): if settings.ALLOW_REGISTER: - email = UniqueEmailField() + email = forms.EmailField() else: - validators = UniqueEmailField.default_validators + [has_valid_realm, isnt_mit] - email = UniqueEmailField(validators=validators) + validators = [has_valid_realm, isnt_mit, is_active] + email = forms.EmailField(validators=validators) class LoggingSetPasswordForm(SetPasswordForm): def save(self, commit=True): diff --git a/zephyr/views.py b/zephyr/views.py index b4da3e2e9d..925f886c26 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -355,7 +355,8 @@ def accounts_home(request): return HttpResponseRedirect(reverse('send_confirm', kwargs={'email':user.email})) try: email = request.POST['email'] - is_unique(email) + # Note: We don't check for uniqueness + is_active(email) except ValidationError: return HttpResponseRedirect(reverse('django.contrib.auth.views.login') + '?email=' + urllib.quote_plus(email)) else: