Commits

Patrick Samson committed 937dd84

pull request #4 rewriting

Comments (0)

Files changed (1)

postman/templatetags/postman_tags.py

 import datetime
 
+from django import VERSION
 from django.http import QueryDict
 from django.template import Node
 from django.template import TemplateSyntaxError
         arg = unicode(arg)
     return _('<me>') if value == arg else value
 
-import django
-if django.VERSION >= (1, 4):
-    date_filter_params = {'expects_localtime':True}
-else:
-    date_filter_params = {}
-
-@register.filter(**date_filter_params)
+@register.filter(**({'expects_localtime': True, 'is_safe': False} if VERSION >= (1, 4) else {}))
 def compact_date(value, arg):
     """
     Output a date as short as possible.