launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25854
[Merge] ~cjwatson/launchpad:py3-accessartifact-delete into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-accessartifact-delete into launchpad:master.
Commit message:
Fix AccessArtifact.delete for Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/395294
We can't rely on the loop variable from an earlier list comprehension, since in Python 3 it goes out of scope.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-accessartifact-delete into launchpad:master.
diff --git a/lib/lp/registry/model/accesspolicy.py b/lib/lp/registry/model/accesspolicy.py
index 8e96af9..871291c 100644
--- a/lib/lp/registry/model/accesspolicy.py
+++ b/lib/lp/registry/model/accesspolicy.py
@@ -181,7 +181,7 @@ class AccessArtifact(StormBase):
ids = [abstract.id for abstract in abstracts]
getUtility(IAccessArtifactGrantSource).revokeByArtifact(abstracts)
getUtility(IAccessPolicyArtifactSource).deleteByArtifact(abstracts)
- IStore(abstract).find(cls, cls.id.is_in(ids)).remove()
+ IStore(abstracts[0]).find(cls, cls.id.is_in(ids)).remove()
@implementer(IAccessPolicy)