diff --git a/newsletter/views.py b/newsletter/views.py index 53326bed..5910c865 100644 --- a/newsletter/views.py +++ b/newsletter/views.py @@ -2,10 +2,9 @@ logger = logging.getLogger(__name__) - import datetime +import socket -from socket import gaierror from smtplib import SMTPException from django.core.exceptions import ValidationError, ImproperlyConfigured @@ -415,7 +414,7 @@ def form_valid(self, form): try: self.subscription.send_activation_email(action=self.action) - except (SMTPException, gaierror), e: + except (SMTPException, socket.error), e: logger.exception( 'Error %s while submitting email to %s.', e, self.subscription.email