← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/better-error-+archivesubscriptions into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/better-error-+archivesubscriptions into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #891607 in Launchpad itself: "Supplying a non-int to the +archivesubscriptions page causes an oops"
  https://bugs.launchpad.net/launchpad/+bug/891607

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/better-error-+archivesubscriptions/+merge/89798

Deal with the case where the archive id is not a number, and return not found.
-- 
https://code.launchpad.net/~stevenk/launchpad/better-error-+archivesubscriptions/+merge/89798
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/better-error-+archivesubscriptions into lp:launchpad.
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py	2012-01-17 23:55:44 +0000
+++ lib/lp/registry/browser/person.py	2012-01-23 22:37:24 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0211,E0213,C0322
@@ -497,6 +497,8 @@
             # In which case we assume it is the archive_id (for the
             # moment, archive name will be an option soon).
             archive_id = self.request.stepstogo.consume()
+            if not archive_id.isdigit():
+                return None
             return traverse_archive_subscription_for_subscriber(
                 self.context, archive_id)
         else:

=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt'
--- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt	2012-01-15 13:32:27 +0000
+++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt	2012-01-23 22:37:24 +0000
@@ -221,3 +221,11 @@
     PPA named p3a for Mark Shuttleworth (ppa:mark/p3a) Mark Shuttleworth View
     PPA named p3a for Celso Providelo (ppa:cprov/p3a)  Celso Providelo   View
 
+== Attempting to browse directly to a subscription ==
+
+    >>> joe_browser.open(
+    ...     "http://launchpad.dev/~joesmith/+archivesubscriptions/foo";)
+    Traceback (most recent call last):
+    ...
+    NotFound...
+