Abhilash Raj has proposed merging lp:~raj-abhilash1/postorius/lp1437866 into 
lp:postorius.

Requested reviews:
  Mailman Coders (mailman-coders)

For more details, see:
https://code.launchpad.net/~raj-abhilash1/postorius/lp1437866/+merge/255981

Fix #1437866 and a duplicate #1430682 
-- 
Your team Mailman Coders is requested to review the proposed merge of 
lp:~raj-abhilash1/postorius/lp1437866 into lp:postorius.
=== modified file 'src/postorius/models.py'
--- src/postorius/models.py	2015-03-25 12:56:26 +0000
+++ src/postorius/models.py	2015-04-13 15:16:21 +0000
@@ -26,6 +26,7 @@
 from datetime import datetime, timedelta
 from django.conf import settings
 from django.contrib.auth.models import User
+from django.core.exceptions import ImproperlyConfigured
 from django.core.urlresolvers import reverse
 from django.core.mail import send_mail
 from django.db import models
@@ -289,7 +290,16 @@
                 {'activation_link': activation_link, 'host_url': host_url})
         email_subject = getattr(
             settings, 'EMAIL_CONFIRMATION_SUBJECT', u'Confirmation needed')
+        try:
+            sender_address = getattr(settings, 'EMAIL_CONFIRMATION_FROM')
+        except AttributeError:
+            # settings.EMAIL_CONFIRMATION_FROM is not defined, fallback
+            # settings.DEFAULT_EMAIL_FROM as mentioned in the django
+            # docs. At the end just raise a `ImproperlyConfigured` Error.
+            sender_address = getattr(settings, 'DEFAULT_FROM_EMAIL')
+        else:
+            raise ImproperlyConfigured
         send_mail(email_subject,
                   get_template(template_path).render(template_context),
-                  getattr(settings, 'EMAIL_CONFIRMATION_FROM'),
+                  sender_address,
                   [self.email])

=== modified file 'src/postorius/templates/postorius/user_address_activation_sent.html'
--- src/postorius/templates/postorius/user_address_activation_sent.html	2015-01-09 15:40:51 +0000
+++ src/postorius/templates/postorius/user_address_activation_sent.html	2015-04-13 15:16:21 +0000
@@ -7,4 +7,3 @@
     <h1>{% trans 'Email address activation sent' %}</h1>
     <p>{% trans "A confirmation link has been sent to the email address you submitted. Please check your email account and click on the confirmation link to add this address for your account." %}</p>
 {% endblock main %}
-

_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to