Verified Commit d3a927e4 authored by Giancarlo Razzolini's avatar Giancarlo Razzolini
Browse files

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.
parent 41201913
......@@ -40,13 +40,13 @@ def form_valid(self, form):
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),
......
Supports Markdown
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