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)
_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help : https://help.launchpad.net/ListHelp