Merge lp:~julian-edwards/launchpad/oops-copy-build-bug-599824 into lp:launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: 11091
Proposed branch: lp:~julian-edwards/launchpad/oops-copy-build-bug-599824
Merge into: lp:launchpad
Diff against target: 39 lines (+6/-5)
2 files modified
lib/lp/soyuz/doc/archive.txt (+2/-4)
lib/lp/soyuz/model/archive.py (+4/-1)
To merge this branch: bzr merge lp:~julian-edwards/launchpad/oops-copy-build-bug-599824
Reviewer Review Type Date Requested Status
Māris Fogels (community) release-critical Approve
Brad Crittenden (community) code Approve
Review via email: mp+29089@code.launchpad.net

Description of the change

When viewing failed builds in copy archives, the page currently OOPSes unless you're a buildd-admin. This is because the page checks to see if you're an uploader so it can decide whether to render a retry button or not.

The code that checks if you're an uploader,for some bizarre reason, raises an AssertionError instead of just returning False.

The change just makes it return False. This doesn't affect anything other than the UI because it's impossible to upload to copy archives for technical reasons anyway.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)
Revision history for this message
Māris Fogels (mars) wrote :

Following a discussion on IRC: Looks good, release-critical=mars.

review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/doc/archive.txt'
2--- lib/lp/soyuz/doc/archive.txt 2010-06-28 14:41:21 +0000
3+++ lib/lp/soyuz/doc/archive.txt 2010-07-02 14:24:33 +0000
4@@ -276,10 +276,8 @@
5
6 Uploads to copy archives are not allowed.
7
8- >>> rebuild_archive.checkArchivePermission(cprov)
9- Traceback (most recent call last):
10- ...
11- AssertionError: Uploads to copy archives are not allowed.
12+ >>> print rebuild_archive.checkArchivePermission(cprov)
13+ False
14
15
16 == Published Source and Binary Lookup ==
17
18=== modified file 'lib/lp/soyuz/model/archive.py'
19--- lib/lp/soyuz/model/archive.py 2010-06-30 16:46:35 +0000
20+++ lib/lp/soyuz/model/archive.py 2010-07-02 14:24:33 +0000
21@@ -948,7 +948,6 @@
22
23 def checkArchivePermission(self, user, component_or_package=None):
24 """See `IArchive`."""
25- assert not self.is_copy, "Uploads to copy archives are not allowed."
26 # PPA access is immediately granted if the user is in the PPA
27 # team.
28 if self.is_ppa:
29@@ -964,6 +963,10 @@
30 # ArchivePermission.
31 component_or_package = getUtility(IComponentSet)['main']
32
33+ # Flatly refuse uploads to copy archives, at least for now.
34+ if self.is_copy:
35+ return False
36+
37 # Otherwise any archive, including PPAs, uses the standard
38 # ArchivePermission entries.
39 return self._authenticate(