mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-10 07:20:46 +01:00
Properly check email context keys in newer Python versions. part of #362
This commit is contained in:
parent
9c249a818b
commit
11467f6e50
@ -107,7 +107,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
''' keep new lines in html emails '''
|
''' keep new lines in html emails '''
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
if context.has_key('comment'):
|
if 'comment' in context:
|
||||||
html_txt = context['comment']
|
html_txt = context['comment']
|
||||||
html_txt = html_txt.replace('\r\n', '<br>')
|
html_txt = html_txt.replace('\r\n', '<br>')
|
||||||
context['comment'] = mark_safe(html_txt)
|
context['comment'] = mark_safe(html_txt)
|
||||||
|
Loading…
Reference in New Issue
Block a user