diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-30 12:53:20 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-30 12:53:20 -0600 |
commit | 2fd15b4187f3ef36360ba6dcbf3c8f6cdc7517f9 (patch) | |
tree | eafa1f601608363f75f92400d88f6780d5d61803 | |
parent | ca560f954f7e0865eccb70d1573999c78b286fe3 (diff) |
Move needs_autoescape attribute to @register.filter
This is the preferred and non-deprecated way of doing this in Django
1.4+.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | main/templatetags/pgp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index 5c9fe511..581282b4 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -47,7 +47,8 @@ def user_pgp_key_link(users, key_id): return pgp_key_link(key_id, matched[0].get_full_name()) return pgp_key_link(key_id) -@register.filter + +@register.filter(needs_autoescape=True) def pgp_fingerprint(key_id, autoescape=True): if not key_id: return u'' @@ -56,7 +57,6 @@ def pgp_fingerprint(key_id, autoescape=True): else: esc = lambda x: x return mark_safe(format_key(esc(key_id))) -pgp_fingerprint.needs_autoescape = True @register.assignment_tag |