summaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
authorGiancarlo Razzolini <grazzolini@archlinux.org>2019-10-25 14:58:33 -0300
committerGiancarlo Razzolini <grazzolini@archlinux.org>2019-10-25 14:58:33 -0300
commitd3a927e4e0d8257f35f3e45e59ca9161ce0760f6 (patch)
tree61a4d5771ac993b21a04aed33d11b612d005ce62 /news
parent4120191306c31dac18817244cb91697638e2d738 (diff)
downloadarchweb-d3a927e4e0d8257f35f3e45e59ca9161ce0760f6.tar.gz
archweb-d3a927e4e0d8257f35f3e45e59ca9161ce0760f6.zip
news: Make the check for MAILMAN_PASSWORD backwards compatible
This makes the check work with previous versions of archweb while also taking into account downstreams that might not want or need this change.
Diffstat (limited to 'news')
-rw-r--r--news/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/news/views.py b/news/views.py
index 20a74c3c..24423cca 100644
--- a/news/views.py
+++ b/news/views.py
@@ -40,13 +40,13 @@ class NewsCreateView(CreateView):
newsitem.author = self.request.user
newsitem.slug = find_unique_slug(News, newsitem.title)
newsitem.save()
- if newsitem.send_announce and settings.MAILMAN_PASSWORD:
+ if newsitem.send_announce:
ctx = {
'news': newsitem,
}
- headers = {
- 'Approved': settings.MAILMAN_PASSWORD,
- }
+ headers = dict()
+ if settings.MAILMAN_PASSWORD:
+ headers['Approved'] = settings.MAILMAN_PASSWORD
template = loader.get_template('news/news_email_notification.txt')
EmailMessage(subject='[arch-announce] %s' % newsitem.title,
body=template.render(ctx),