summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-10-01 03:39:59 +0200
committerDan McGee <dan@archlinux.org>2013-10-01 03:45:10 +0200
commit92136757bfd20563999b0e1cf3f05685b60da6bd (patch)
treef74e0fa50f1e9b3cc5e403c991d2da66b9b33e16 /public
parentb3321537d3ec91fd6f8d1123881a94a0490f1bdc (diff)
downloadarchweb-92136757bfd20563999b0e1cf3f05685b60da6bd.tar.gz
archweb-92136757bfd20563999b0e1cf3f05685b60da6bd.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r--public/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/public/views.py b/public/views.py
index 24edd04..f79c8f3 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]