]> git.decadent.org.uk Git - dak.git/commitdiff
dak/admin.py: make 'keyring list-(binary|source)' work with new ACLs
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 16 Sep 2012 21:31:23 +0000 (23:31 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 16 Sep 2012 21:31:23 +0000 (23:31 +0200)
dak/admin.py
daklib/dbconn.py

index c77e93f32845b464922fbeca55ffd4a1fa22934a..798aa3b7b8948a8652760111d5e196e20b505de8 100755 (executable)
@@ -584,9 +584,9 @@ def show_keyring(command):
     if mode == 'list-all':
         pass
     elif mode == 'list-binary':
-        q = q.filter(Keyring.default_source_acl_id == None)
+        q = q.join(Keyring.acl).filter(ACL.allow_source == False)
     elif mode == 'list-source':
-        q = q.filter(Keyring.default_source_acl_id != None)
+        q = q.join(Keyring.acl).filter(ACL.allow_source == True)
     else:
         die("E: keyring command unknown")
 
index 9617bb77a6a00241a77e3bb7332f8336d9bd11a2..41121fff1699014a6db5e3ffd1ba43bc01a83f35 100644 (file)
@@ -2687,7 +2687,8 @@ class DBConn(object):
 
         mapper(Keyring, self.tbl_keyrings,
                properties = dict(keyring_name = self.tbl_keyrings.c.name,
-                                 keyring_id = self.tbl_keyrings.c.id))
+                                 keyring_id = self.tbl_keyrings.c.id,
+                                 acl = relation(ACL, primaryjoin=(self.tbl_keyrings.c.acl_id == self.tbl_acl.c.id)))),
 
         mapper(DBChange, self.tbl_changes,
                properties = dict(change_id = self.tbl_changes.c.id,