~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/archive.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2017-05-11 08:56:39 UTC
  • mfrom: (18361.2.2 person-ppas-timeout)
  • Revision ID: launchpad@pqm.canonical.com-20170511085639-b1d86zhzogh3x6gr
[r=wgrant][bug=1685202] Precache permissions for archives returned by
 Person.getVisiblePPAs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2015 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2017 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Browser views for archive."""
109
109
    Navigation,
110
110
    stepthrough,
111
111
    )
112
 
from lp.services.webapp.authorization import check_permission
 
112
from lp.services.webapp.authorization import (
 
113
    check_permission,
 
114
    precache_permission_for_objects,
 
115
    )
113
116
from lp.services.webapp.batching import BatchNavigator
114
117
from lp.services.webapp.escaping import structured
115
118
from lp.services.webapp.interfaces import (
1885
1888
 
1886
1889
    @cachedproperty
1887
1890
    def visible_ppas(self):
1888
 
        return self.context.getVisiblePPAs(self.user)
 
1891
        ppas = self.context.getVisiblePPAs(self.user)
 
1892
        precache_permission_for_objects(self.request, 'launchpad.View', ppas)
 
1893
        return ppas
1889
1894
 
1890
1895
    @property
1891
1896
    def initial_values(self):