Properly check email context keys in newer Python versions. part of #362

This commit is contained in:
Ross Poulton 2015-12-16 10:48:27 +11:00
parent 9c249a818b
commit 11467f6e50

View File

@ -107,7 +107,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
''' keep new lines in html emails '''
from django.utils.safestring import mark_safe
if context.has_key('comment'):
if 'comment' in context:
html_txt = context['comment']
html_txt = html_txt.replace('\r\n', '<br>')
context['comment'] = mark_safe(html_txt)