← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/branch-unsubscribe-revokes into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/branch-unsubscribe-revokes into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/branch-unsubscribe-revokes/+merge/112272

In https://code.launchpad.net/~stevenk/launchpad/branch-subscribe-aag/+merge/108881 I changed Branch.subscribe() to add an AccessArtifactGrant if required. Unfortunately, I neglected to change Branch.unsubscribe() to remove the AAG, hence this branch.
-- 
https://code.launchpad.net/~stevenk/launchpad/branch-unsubscribe-revokes/+merge/112272
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/branch-unsubscribe-revokes into lp:launchpad.
=== modified file 'lib/lp/code/model/branch.py'
--- lib/lp/code/model/branch.py	2012-06-18 01:04:30 +0000
+++ lib/lp/code/model/branch.py	2012-06-27 06:18:19 +0000
@@ -141,7 +141,11 @@
     validate_person,
     validate_public_person,
     )
-from lp.registry.model.accesspolicy import reconcile_access_for_artifact
+from lp.registry.model.accesspolicy import (
+    IAccessArtifactGrantSource,
+    IAccessArtifactSource,
+    reconcile_access_for_artifact,
+    )
 from lp.services.config import config
 from lp.services.database.bulk import load_related
 from lp.services.database.constants import (
@@ -878,6 +882,9 @@
                     person.displayname))
         store = Store.of(subscription)
         store.remove(subscription)
+        artifact = getUtility(IAccessArtifactSource).find([self])
+        getUtility(IAccessArtifactGrantSource).revokeByArtifact(
+            artifact, [person])
         store.flush()
 
     def getBranchRevision(self, sequence=None, revision=None,


Follow ups