Skip to content
Browse files

Only add message if a result is returned

  • Loading branch information...
1 parent 2c27c10 commit 4537c3d54693b22ecbb4417cabc2150b3860197b @paltman paltman committed Nov 10, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 reminders/templatetags/reminders_tags.py
View
10 reminders/templatetags/reminders_tags.py
@@ -48,10 +48,12 @@ def render(self, context):
url = None
if settings.REMINDERS[label].get("dismissable", True):
url = reverse("reminders_dismiss", kwargs={"label": label})
- reminders.append({
- "message": mark_safe(message % test(request.user)),
- "dismiss_url": url
- })
+ result = test(request.user)
+ if result:
+ reminders.append({
+ "message": mark_safe(message % test(request.user)),
+ "dismiss_url": url
+ })
context[self.as_var] = reminders
return ""

0 comments on commit 4537c3d

Please sign in to comment.
Something went wrong with that request. Please try again.