From c69efa1587267c74ab3818186da0ece6070b8e29 Mon Sep 17 00:00:00 2001 From: Andreas Kotowicz Date: Tue, 8 Feb 2011 12:17:05 +0100 Subject: [PATCH] fix for bug https://github.com/rossp/django-helpdesk/issues#issue/37 --- helpdesk/lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 751948fb..c48e6e35 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -89,9 +89,10 @@ 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 - html_txt = context['comment'] - html_txt = html_txt.replace('\r\n', '
') - context['comment'] = mark_safe(html_txt) + if context.has_key('comment'): + html_txt = context['comment'] + html_txt = html_txt.replace('\r\n', '
') + context['comment'] = mark_safe(html_txt) html_part = loader.get_template_from_string( "{%% extends '%s' %%}{%% block title %%}%s{%% endblock %%}{%% block content %%}%s{%% endblock %%}" % (email_html_base_file, t.heading, t.html)