Permalink
Browse files

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

git-svn-id: https://django-notification.googlecode.com/svn/trunk@102 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent 2a6386e commit b8ad0183f8a9316ad0eeacd5289739a38677a184 @brosner brosner committed Sep 28, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 notification/models.py
View
@@ -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 b8ad018

Please sign in to comment.