Commit bb045502 authored by fred's avatar fred
Browse files

normalize email addresses to lowercase

parent d845676b
......@@ -72,6 +72,7 @@ class Subscriber(models.Model):
dc = settings.MAILCHIMP_DC
apikey = settings.MAILCHIMP_APIKEY
list_id = settings.MAILCHIMP_LIST_ID
self.email = self.email.lower()
email_hash = hashlib.md5(self.email.encode()).hexdigest()
......
......@@ -42,6 +42,7 @@ class SubscribeView(CreateView):
or self.request.META.get('REMOTE_ADDR')
)
self.object.user_agent = self.request.META.get('HTTP_USER_AGENT')
self.object.email = self.object.email.lower()
self.object.save()
if not self.object.is_from_bot() and getattr(settings, 'NEWSLETTER_SEND_CONFIRMATION', True):
self.object.send_confirmation_email()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment