Merge lp:~stevenk/launchpad/hide-build-portlet-archive into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 16520
Proposed branch: lp:~stevenk/launchpad/hide-build-portlet-archive
Merge into: lp:launchpad
Diff against target: 54 lines (+11/-4)
2 files modified
lib/lp/soyuz/templates/archive-macros.pt (+2/-1)
lib/lp/soyuz/tests/test_archive_subscriptions.py (+9/-3)
To merge this branch: bzr merge lp:~stevenk/launchpad/hide-build-portlet-archive
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+151864@code.launchpad.net

Commit message

Hide the Latest Updates portlet on Archive:+index if View isn't held -- subscribers to the archive shouldn't be shown build information.

Description of the change

Hide the Latest Updates portlet on Archive:+index if View isn't held -- subscribers to the archive shouldn't be shown build information, and if the portlet tries to drill down to show failures they will get a 403.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/soyuz/templates/archive-macros.pt'
--- lib/lp/soyuz/templates/archive-macros.pt 2012-11-01 03:41:36 +0000
+++ lib/lp/soyuz/templates/archive-macros.pt 2013-03-07 00:54:22 +0000
@@ -318,7 +318,8 @@
318 Present the latest updates for a PPA in a portlet.318 Present the latest updates for a PPA in a portlet.
319 </tal:comment>319 </tal:comment>
320320
321 <tal:latest_updates define="updates view/latest_updates">321 <tal:latest_updates define="updates view/latest_updates"
322 tal:condition="context/required:launchpad.View">
322 <div id="portlet-latest-updates" class="portlet">323 <div id="portlet-latest-updates" class="portlet">
323 <h2>Latest updates</h2>324 <h2>Latest updates</h2>
324325
325326
=== modified file 'lib/lp/soyuz/tests/test_archive_subscriptions.py'
--- lib/lp/soyuz/tests/test_archive_subscriptions.py 2013-02-20 04:29:41 +0000
+++ lib/lp/soyuz/tests/test_archive_subscriptions.py 2013-03-07 00:54:22 +0000
@@ -6,10 +6,13 @@
6from urlparse import urljoin6from urlparse import urljoin
77
8from zope.security.interfaces import Unauthorized8from zope.security.interfaces import Unauthorized
9from zope.security.proxy import removeSecurityProxy
910
11from lp.buildmaster.enums import BuildStatus
10from lp.registry.interfaces.person import PersonVisibility12from lp.registry.interfaces.person import PersonVisibility
11from lp.services.webapp.authorization import check_permission13from lp.services.webapp.authorization import check_permission
12from lp.services.webapp.publisher import canonical_url14from lp.services.webapp.publisher import canonical_url
15from lp.soyuz.enums import PackagePublishingStatus
13from lp.testing import (16from lp.testing import (
14 BrowserTestCase,17 BrowserTestCase,
15 login_person,18 login_person,
@@ -136,7 +139,12 @@
136 with person_logged_in(self.owner):139 with person_logged_in(self.owner):
137 self.archive = self.factory.makeArchive(140 self.archive = self.factory.makeArchive(
138 private=True, owner=self.private_team)141 private=True, owner=self.private_team)
139 self.factory.makeSourcePackagePublishingHistory(archive=self.archive)142 spph = self.factory.makeSourcePackagePublishingHistory(
143 archive=self.archive, status=PackagePublishingStatus.PUBLISHED)
144 spr = removeSecurityProxy(spph).sourcepackagerelease
145 self.factory.makeBinaryPackageBuild(
146 source_package_release=spr, archive=self.archive,
147 status=BuildStatus.FAILEDTOBUILD)
140 self.subscriber = self.factory.makePerson()148 self.subscriber = self.factory.makePerson()
141149
142 def test_traverse_view_private_team_archive_subscriber(self):150 def test_traverse_view_private_team_archive_subscriber(self):
@@ -150,8 +158,6 @@
150 browser.open(url)158 browser.open(url)
151 content = find_tag_by_id(browser.contents, 'document')159 content = find_tag_by_id(browser.contents, 'document')
152 self.assertIsNotNone(find_tag_by_id(content, 'ppa-install'))160 self.assertIsNotNone(find_tag_by_id(content, 'ppa-install'))
153 self.assertIsNotNone(
154 find_tag_by_id(content, 'portlet-latest-updates'))
155161
156 def test_unauthorized_subscriber_for_plus_packages(self):162 def test_unauthorized_subscriber_for_plus_packages(self):
157 with person_logged_in(self.owner):163 with person_logged_in(self.owner):