From c20357b75df455f9b7d905b476b7a56184f08474 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 5 Oct 2016 15:16:03 +0000 Subject: [PATCH] Fixed a place where email addresses not all lowercase could slip in, which can mess up reverse table relationships. - Legacy-Id: 12088 --- ietf/community/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ietf/community/forms.py b/ietf/community/forms.py index d6dce1a68..1398b7110 100644 --- a/ietf/community/forms.py +++ b/ietf/community/forms.py @@ -105,6 +105,9 @@ class SubscriptionForm(forms.ModelForm): if self.fields["email"].queryset: self.fields["email"].initial = self.fields["email"].queryset[0] + def clean_email(self): + return self.cleaned_data["email"].strip().lower() + def clean(self): if EmailSubscription.objects.filter(community_list=self.clist, email=self.cleaned_data["email"], notify_on=self.cleaned_data["notify_on"]).exists(): raise forms.ValidationError("You already have a subscription like this.")