Skip to content

Commit

Permalink
Conditionally turn off autoescaping for .txt extensions in the format.
Browse files Browse the repository at this point in the history
git-svn-id: http://django-notification.googlecode.com/svn/trunk@102 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information
brosner committed Sep 28, 2008
1 parent f14d10f commit 1da2eca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions notification/models.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def get_formatted_messages(formats, label, context):
""" """
format_templates = {} format_templates = {}
for format in formats: for format in formats:
# conditionally turn off autoescaping for .txt extensions in format
if format.endswith(".txt"):
context.autoescape = False
name = format.split(".")[0] name = format.split(".")[0]
format_templates[name] = render_to_string(( format_templates[name] = render_to_string((
'notification/%s/%s' % (label, format), 'notification/%s/%s' % (label, format),
Expand Down

0 comments on commit 1da2eca

Please sign in to comment.