Merge lp:~gmb/launchpad/archive-subscriptions-bug-823473 into lp:launchpad

Proposed by Graham Binns
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 14387
Proposed branch: lp:~gmb/launchpad/archive-subscriptions-bug-823473
Merge into: lp:launchpad
Diff against target: 35 lines (+11/-3)
2 files modified
lib/lp/soyuz/browser/archive.py (+2/-3)
lib/lp/soyuz/stories/webservice/xx-archive.txt (+9/-0)
To merge this branch: bzr merge lp:~gmb/launchpad/archive-subscriptions-bug-823473
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+83407@code.launchpad.net

Commit message

[r=bac][bug=823473] ArchiveNavigation.traverse_subscription no longer errors when the user passed to it doesn't exist.

Description of the change

This branch is a simple fix for bug 823473. Francis identified the problem in the bug comments, and the fix was simply to remove the useless try..except from traverse_subscription.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Looks great, thanks Graham and Francis.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/archive.py'
2--- lib/lp/soyuz/browser/archive.py 2011-11-09 16:17:44 +0000
3+++ lib/lp/soyuz/browser/archive.py 2011-11-25 15:12:25 +0000
4@@ -316,9 +316,8 @@
5
6 @stepthrough('+subscriptions')
7 def traverse_subscription(self, person_name):
8- try:
9- person = getUtility(IPersonSet).getByName(person_name)
10- except NotFoundError:
11+ person = getUtility(IPersonSet).getByName(person_name)
12+ if person is None:
13 return None
14
15 subscriptions = getUtility(IArchiveSubscriberSet).getBySubscriber(
16
17=== modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt'
18--- lib/lp/soyuz/stories/webservice/xx-archive.txt 2011-09-12 18:06:59 +0000
19+++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2011-11-25 15:12:25 +0000
20@@ -1066,6 +1066,15 @@
21 Mark Shuttleworth already has a current subscription
22 for 'PPA named p3a for Celso Providelo'.
23
24+If we try to look at the subscription of a user that doesn't exist,
25+Launchpad will return a 404.
26+
27+ >>> response = cprov_webservice.get(
28+ ... cprov_private_ppa['self_link'] + '/+subscriptions/dave')
29+ >>> print response
30+ HTTP/1.1 404 Not Found
31+ ...
32+
33
34 Modifying privacy
35 ~~~~~~~~~~~~~~~~~