Merge lp:~raj-abhilash1/postorius/lp1437866 into lp:postorius

Proposed by Abhilash Raj
Status: Merged
Merged at revision: 212
Proposed branch: lp:~raj-abhilash1/postorius/lp1437866
Merge into: lp:postorius
Diff against target: 38 lines (+11/-2)
2 files modified
src/postorius/models.py (+11/-1)
src/postorius/templates/postorius/user_address_activation_sent.html (+0/-1)
To merge this branch: bzr merge lp:~raj-abhilash1/postorius/lp1437866
Reviewer Review Type Date Requested Status
Mailman Coders Pending
Review via email: mp+255981@code.launchpad.net

Description of the change

Fix #1437866 and a duplicate #1430682

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/postorius/models.py'
2--- src/postorius/models.py 2015-03-25 12:56:26 +0000
3+++ src/postorius/models.py 2015-04-13 15:16:21 +0000
4@@ -26,6 +26,7 @@
5 from datetime import datetime, timedelta
6 from django.conf import settings
7 from django.contrib.auth.models import User
8+from django.core.exceptions import ImproperlyConfigured
9 from django.core.urlresolvers import reverse
10 from django.core.mail import send_mail
11 from django.db import models
12@@ -289,7 +290,16 @@
13 {'activation_link': activation_link, 'host_url': host_url})
14 email_subject = getattr(
15 settings, 'EMAIL_CONFIRMATION_SUBJECT', u'Confirmation needed')
16+ try:
17+ sender_address = getattr(settings, 'EMAIL_CONFIRMATION_FROM')
18+ except AttributeError:
19+ # settings.EMAIL_CONFIRMATION_FROM is not defined, fallback
20+ # settings.DEFAULT_EMAIL_FROM as mentioned in the django
21+ # docs. At the end just raise a `ImproperlyConfigured` Error.
22+ sender_address = getattr(settings, 'DEFAULT_FROM_EMAIL')
23+ else:
24+ raise ImproperlyConfigured
25 send_mail(email_subject,
26 get_template(template_path).render(template_context),
27- getattr(settings, 'EMAIL_CONFIRMATION_FROM'),
28+ sender_address,
29 [self.email])
30
31=== modified file 'src/postorius/templates/postorius/user_address_activation_sent.html'
32--- src/postorius/templates/postorius/user_address_activation_sent.html 2015-01-09 15:40:51 +0000
33+++ src/postorius/templates/postorius/user_address_activation_sent.html 2015-04-13 15:16:21 +0000
34@@ -7,4 +7,3 @@
35 <h1>{% trans 'Email address activation sent' %}</h1>
36 <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>
37 {% endblock main %}
38-

Subscribers

People subscribed via source and target branches