From 92136757bfd20563999b0e1cf3f05685b60da6bd Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 30 Sep 2013 20:39:59 -0500 Subject: Proper support for revoked signatures The 'valid' column wasn't quite right. Add a new 'revoked' column that works similar to the one we have on keys and use it instead, properly parsing the output from `gpg` signature data and looking for the magic prefix string. Signed-off-by: Dan McGee --- public/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'public') diff --git a/public/views.py b/public/views.py index 24edd044..f79c8f32 100644 --- a/public/views.py +++ b/public/views.py @@ -126,7 +126,7 @@ def keys(request): 'owner__userprofile', 'revoker__userprofile').filter( revoked__isnull=True) - sig_counts = PGPSignature.objects.filter(not_expired, valid=True, + sig_counts = PGPSignature.objects.filter(not_expired, revoked__isnull=True, signee__in=user_key_ids).order_by().values_list('signer').annotate( Count('signer')) sig_counts = {key_id[-16:]: ct for key_id, ct in sig_counts} @@ -136,11 +136,11 @@ def keys(request): # frozenset because we are going to do lots of __contains__ lookups signatures = frozenset(PGPSignature.objects.filter( - not_expired, valid=True).values_list('signer', 'signee')) + not_expired, revoked__isnull=True).values_list('signer', 'signee')) restrict = Q(signer__in=user_key_ids) & Q(signee__in=user_key_ids) cross_signatures = PGPSignature.objects.filter(restrict, - not_expired, valid=True).order_by('created') + not_expired, revoked__isnull=True).order_by('created') context = { 'keys': master_keys, @@ -183,7 +183,7 @@ def keys_json(request): }) not_expired = Q(expires__gt=datetime.utcnow) | Q(expires__isnull=True) - signatures = PGPSignature.objects.filter(not_expired, valid=True) + signatures = PGPSignature.objects.filter(not_expired, revoked__isnull=True) edge_list = [{ 'signee': sig.signee, 'signer': sig.signer } for sig in signatures] -- cgit v1.2.3-55-g3dc8