Merge lp:~bac/launchpad/bug-838957 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13898 |
Proposed branch: | lp:~bac/launchpad/bug-838957 |
Merge into: | lp:launchpad |
Diff against target: |
79 lines (+35/-5) 3 files modified
lib/lp/bugs/browser/bugtask.py (+8/-2) lib/lp/bugs/browser/tests/test_buglisting.py (+23/-0) lib/lp/bugs/model/bugtask.py (+4/-3) |
To merge this branch: | bzr merge lp:~bac/launchpad/bug-838957 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+74460@code.launchpad.net |
Commit message
[r=abentley][bug=838957] Catch exception rather than throw OOPS on bug search with hacked URL.
Description of the change
= Summary =
Only distributions should have 'components' as part of an advanced bug
search. Hacked URLs, however, could allow that condition to happen.
In that event we should display a helpful message to the user rather
than throwing an OOPS.
== Proposed fix ==
Change the assert to raising a ValueError which is caught, subdued,
and turned into said notice.
== Pre-implementation notes ==
Nah.
== Implementation details ==
As above.
== Tests ==
bin/test -vvm -t test_buglisting
== Demo and Q/A ==
Go to https:/
Select a component
Search
Now, hack the URL to change 'ubuntu' to 'firefox'.
See the message and a redirect to the main bugs page for firefox.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
You may wish to rewrite the "except" block as "except ValueError as e". I think this syntax is considered clearer. Otherwise, this looks fine.