Permalink
Browse files

Mark the message safe so html renders properly

  • Loading branch information...
1 parent a298216 commit 201a21ff273b7d675cebf9bcf42700efdcee55e5 @paltman paltman committed Nov 10, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 reminders/templatetags/reminders_tags.py
@@ -2,6 +2,7 @@
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.importlib import import_module
+from django.utils.safestring import mark_safe
register = template.Library()
@@ -30,7 +31,6 @@ def handle_token(cls, parser, token):
bits = token.split_contents()
if len(bits) != 3:
raise template.TemplateSyntaxError
-
return cls(as_var = bits[2])
def __init__(self, as_var):
@@ -42,13 +42,14 @@ def render(self, context):
for label in settings.REMINDERS:
if label not in request.session:
test = settings.REMINDERS[label]["test"]
+ message = settings.REMINDERS[label]["message"]
if not callable(test):
test = load_callable(test)
url = None
if settings.REMINDERS[label].get("dismissable", True):
url = reverse("reminders_dismiss", kwargs={"label": label})
reminders.append({
- "message": test(request.user),
+ "message": mark_safe(message % test(request.user)),
"dismiss_url": url
})
context[self.as_var] = reminders

0 comments on commit 201a21f

Please sign in to comment.