From 002574cce1d9756ba28a87a038f6906b566f2e2a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 21 Oct 2011 18:16:49 -0500 Subject: Accept 40 hex char PGP key signatures only Signed-off-by: Dan McGee --- main/templatetags/pgp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'main/templatetags') diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index 956de892..f875c11e 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -4,7 +4,6 @@ from django.conf import settings register = template.Library() def format_key(key_id): - print len(key_id) if len(key_id) in (8, 20): return u'0x%s' % key_id elif len(key_id) == 40: @@ -24,7 +23,7 @@ def pgp_key_link(key_id): return format_key(key_id) url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ (pgp_server, key_id) - values = (url, key_id, format_key(key_id)) - return '%s' % values + values = (url, format_key(key_id), key_id[-8:]) + return '0x%s' % values # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b From 886630dd4e65a7be6d1bd3d8a0e70ab24e5affc6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 8 Nov 2011 13:55:38 -0600 Subject: Always use same URL for both secure and non-secure CDN requests Use a scheme-relative URL rather than serving different content to users based on HTTP or HTTPS. Should prevent mismatched certificate errors. Signed-off-by: Dan McGee --- main/templatetags/cdn.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'main/templatetags') diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py index c25040c0..5cb12fcf 100644 --- a/main/templatetags/cdn.py +++ b/main/templatetags/cdn.py @@ -23,12 +23,7 @@ class CDNPrefixNode(template.Node): oncdn = getattr(settings, 'CDN_ENABLED', True) if not oncdn: return '' - secure = 'secure' in context and context['secure'] # if left undefined, same behavior as if CDN is turned off - paths = { - False: getattr(settings, 'CDN_PATH', ''), - True: getattr(settings, 'CDN_PATH_SECURE', ''), - } - return paths[secure] + return getattr(settings, 'CDN_PATH', '') # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b From 5b63c29fe1c37ce9d946adedeaf13f5ad94d144a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 15 Nov 2011 14:03:36 -0600 Subject: Show full names on developer user list pages The old display format doesn't really make sense. Also fix the invalid HTML generated by the PGP tag link- we need to escape using & inside the generated URLs. Signed-off-by: Dan McGee --- main/templatetags/pgp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/templatetags') diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index f875c11e..67f5e08d 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -21,7 +21,7 @@ def pgp_key_link(key_id): pgp_server = getattr(settings, 'PGP_SERVER', None) if not pgp_server: return format_key(key_id) - url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ + url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ (pgp_server, key_id) values = (url, format_key(key_id), key_id[-8:]) return '0x%s' % values -- cgit v1.2.3-2-g168b