Permalink
Browse files

Conditionally turn off autoescaping for .txt extensions in the format.

git-svn-id: http://django-notification.googlecode.com/svn/trunk@102 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent f14d10f commit 1da2eca1ad1b6b002482489ef386a30a1eade3f0 @brosner brosner committed Sep 28, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 notification/models.py
View
3 notification/models.py
@@ -216,6 +216,9 @@ def get_formatted_messages(formats, label, context):
"""
format_templates = {}
for format in formats:
+ # conditionally turn off autoescaping for .txt extensions in format
+ if format.endswith(".txt"):
+ context.autoescape = False
name = format.split(".")[0]
format_templates[name] = render_to_string((
'notification/%s/%s' % (label, format),

0 comments on commit 1da2eca

Please sign in to comment.