← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Graham Binns has proposed merging lp:~gmb/launchpad/archive-subscriptions-bug-823473 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #823473 in Launchpad itself: "AttributeError getting archive subscriptions for a given person"
  https://bugs.launchpad.net/launchpad/+bug/823473

For more details, see:
https://code.launchpad.net/~gmb/launchpad/archive-subscriptions-bug-823473/+merge/83407

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.
-- 
https://code.launchpad.net/~gmb/launchpad/archive-subscriptions-bug-823473/+merge/83407
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gmb/launchpad/archive-subscriptions-bug-823473 into lp:launchpad.
=== 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 @@
 
     @stepthrough('+subscriptions')
     def traverse_subscription(self, person_name):
-        try:
-            person = getUtility(IPersonSet).getByName(person_name)
-        except NotFoundError:
+        person = getUtility(IPersonSet).getByName(person_name)
+        if person is None:
             return None
 
         subscriptions = getUtility(IArchiveSubscriberSet).getBySubscriber(

=== 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 @@
     Mark Shuttleworth already has a current subscription
     for 'PPA named p3a for Celso Providelo'.
 
+If we try to look at the subscription of a user that doesn't exist,
+Launchpad will return a 404.
+
+    >>> response = cprov_webservice.get(
+    ...     cprov_private_ppa['self_link'] + '/+subscriptions/dave')
+    >>> print response
+    HTTP/1.1 404 Not Found
+    ...
+
 
 Modifying privacy
 ~~~~~~~~~~~~~~~~~