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
=== modified file 'lib/lp/soyuz/browser/archive.py'
--- lib/lp/soyuz/browser/archive.py 2011-11-09 16:17:44 +0000
+++ lib/lp/soyuz/browser/archive.py 2011-11-25 15:12:25 +0000
@@ -316,9 +316,8 @@
316316
317 @stepthrough('+subscriptions')317 @stepthrough('+subscriptions')
318 def traverse_subscription(self, person_name):318 def traverse_subscription(self, person_name):
319 try:319 person = getUtility(IPersonSet).getByName(person_name)
320 person = getUtility(IPersonSet).getByName(person_name)320 if person is None:
321 except NotFoundError:
322 return None321 return None
323322
324 subscriptions = getUtility(IArchiveSubscriberSet).getBySubscriber(323 subscriptions = getUtility(IArchiveSubscriberSet).getBySubscriber(
325324
=== modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt'
--- lib/lp/soyuz/stories/webservice/xx-archive.txt 2011-09-12 18:06:59 +0000
+++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2011-11-25 15:12:25 +0000
@@ -1066,6 +1066,15 @@
1066 Mark Shuttleworth already has a current subscription1066 Mark Shuttleworth already has a current subscription
1067 for 'PPA named p3a for Celso Providelo'.1067 for 'PPA named p3a for Celso Providelo'.
10681068
1069If we try to look at the subscription of a user that doesn't exist,
1070Launchpad will return a 404.
1071
1072 >>> response = cprov_webservice.get(
1073 ... cprov_private_ppa['self_link'] + '/+subscriptions/dave')
1074 >>> print response
1075 HTTP/1.1 404 Not Found
1076 ...
1077
10691078
1070Modifying privacy1079Modifying privacy
1071~~~~~~~~~~~~~~~~~1080~~~~~~~~~~~~~~~~~