launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19417
Re: [Merge] lp:~cjwatson/launchpad/import-warnings into lp:launchpad
Diff comments:
>
> === modified file 'lib/lp/soyuz/model/archivesubscriber.py'
> --- lib/lp/soyuz/model/archivesubscriber.py 2015-07-08 16:05:11 +0000
> +++ lib/lp/soyuz/model/archivesubscriber.py 2015-09-21 10:22:52 +0000
> @@ -204,7 +212,20 @@
>
> def getBySubscriberWithActiveToken(self, subscriber, archive=None):
> """See `IArchiveSubscriberSet`."""
> - return self._getBySubscriber(subscriber, archive, True, True)
> + result = self._getBySubscriber(subscriber, archive, True, True)
> +
> + def eager_load(rows):
> + user = getUtility(ILaunchBag).user
> + subscriptions = map(itemgetter(0), rows)
> + precache_permission_for_objects(
> + None, 'launchpad.View', subscriptions)
> + archives = load_related(Archive, subscriptions, ['archive_id'])
> + list(getUtility(IPersonSet).getPrecachedPersonsFromIDs(
> + [archive.ownerID for archive in archives], need_validity=True))
> + for archive in archives:
> + get_property_cache(archive)._known_subscribers = [user]
Indeed - I moved it back to the view in my recent commits, and I also removed this assumption since there's no reason we need to make it even in the view.
> +
> + return DecoratedResultSet(result, pre_iter_hook=eager_load)
>
> def getByArchive(self, archive, current_only=True):
> """See `IArchiveSubscriberSet`."""
--
https://code.launchpad.net/~cjwatson/launchpad/import-warnings/+merge/271790
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
References