]> err.no Git - dak/commitdiff
dak/acl.py: only add fingerprints from active keyrings to an ACL.
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 27 Jan 2013 12:50:40 +0000 (13:50 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 27 Jan 2013 13:05:51 +0000 (14:05 +0100)
dak/acl.py

index 10a6372946177ecc6f113ed3c44a1f24eea75750..a6fdddd953c041d13bd74a348bc9aec3fb7d8975 100644 (file)
@@ -55,7 +55,7 @@ def get_fingerprint(entry, session):
     @return: fingerprint for the entry
     """
     field, value = entry.split(":", 1)
-    q = session.query(Fingerprint)
+    q = session.query(Fingerprint).join(Fingerprint.keyring).filter(Keyring.active == True)
 
     if field == 'uid':
         q = q.join(Fingerprint.uid).filter(Uid.uid == value)
@@ -64,7 +64,7 @@ def get_fingerprint(entry, session):
     elif field == 'fpr':
         q = q.filter(Fingerprint.fingerprint == value)
     elif field == 'keyring':
-        q = q.join(Fingerprint.keyring).filter(Keyring.keyring_name == value)
+        q = q.filter(Keyring.keyring_name == value)
     else:
         raise Exception('Unknown selector "{0}".'.format(field))