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

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 14716
Proposed branch: lp:~stevenk/launchpad/better-error-+archivesubscriptions
Merge into: lp:launchpad
Diff against target: 34 lines (+11/-1)
2 files modified
lib/lp/registry/browser/person.py (+3/-1)
lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+8/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/better-error-+archivesubscriptions
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+89798@code.launchpad.net

Commit message

[r=wallyworld][bug=891607] Deal with the case where the archive id is not a number for Person:+archivesubscriptions.

Description of the change

Deal with the case where the archive id is not a number, and return not found.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Looks good. Sometimes where are tests which check the http error code (eg 404 in this case) for given scenarios. Are there any of those which need updating?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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:40:29 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4# pylint: disable-msg=E0211,E0213,C03224# pylint: disable-msg=E0211,E0213,C0322
@@ -497,6 +497,8 @@
497 # In which case we assume it is the archive_id (for the497 # In which case we assume it is the archive_id (for the
498 # moment, archive name will be an option soon).498 # moment, archive name will be an option soon).
499 archive_id = self.request.stepstogo.consume()499 archive_id = self.request.stepstogo.consume()
500 if not archive_id.isdigit():
501 return None
500 return traverse_archive_subscription_for_subscriber(502 return traverse_archive_subscription_for_subscriber(
501 self.context, archive_id)503 self.context, archive_id)
502 else:504 else:
503505
=== 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:40:29 +0000
@@ -221,3 +221,11 @@
221 PPA named p3a for Mark Shuttleworth (ppa:mark/p3a) Mark Shuttleworth View221 PPA named p3a for Mark Shuttleworth (ppa:mark/p3a) Mark Shuttleworth View
222 PPA named p3a for Celso Providelo (ppa:cprov/p3a) Celso Providelo View222 PPA named p3a for Celso Providelo (ppa:cprov/p3a) Celso Providelo View
223223
224== Attempting to browse directly to a subscription ==
225
226 >>> joe_browser.open(
227 ... "http://launchpad.dev/~joesmith/+archivesubscriptions/foo")
228 Traceback (most recent call last):
229 ...
230 NotFound...
231