Merge lp:~jcsackett/launchpad/bugtasks-deacitvated-context-632847 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Graham Binns | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12363 | ||||
Proposed branch: | lp:~jcsackett/launchpad/bugtasks-deacitvated-context-632847 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
201 lines (+73/-16) 4 files modified
lib/lp/bugs/browser/tests/test_buglisting.py (+47/-2) lib/lp/bugs/model/bugtask.py (+12/-0) lib/lp/registry/browser/tests/test_milestone.py (+11/-7) lib/lp/registry/browser/tests/test_person_view.py (+3/-7) |
||||
To merge this branch: | bzr merge lp:~jcsackett/launchpad/bugtasks-deacitvated-context-632847 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Needs Fixing | ||
Graham Binns (community) | code | Approve | |
Review via email: mp+48925@code.launchpad.net |
Commit message
[r=gmb][bug=632847] Adds check to prevent bugtasks for deactivated products from showing up for people who can't see the product.
Description of the change
Summary
=======
Per bug 632847, bugtasks for deactivated projects can show up in search results. Users clicking on links for these bugtasks then get a 404. The best fix for this is to make sure that users that can't verify the deactivated project (i.e. aren't registry admins) don't see those bugtasks.
Preimplementation
=================
Spoke with Deryck Hodge and Curtis Hovey
Proposed Fix
============
Add a step in the query building for bug search that checks is the searching user is in registry admins; if they're not, filter out bugtasks for deactivated products.
Implementation
==============
lib/lp/
-------
Tests added.
lib/lp/
-------
A check is added to see if the searching user is in registry admins; if they're not, an extra clause is added to the query to remove products that are deactivated.
lib/lp/
-------
Drive by clean up of whitespace while trying to decide where to place new tests.
Tests
=====
bin/test -t test_buglisting
Demo & QA
=========
Using the link provided in the bug (though switch to qastaging). If you are signed in and are a member of registry admins, you should see the bugtask reported as problematic in the bugtask. If you are not in registry admins (or logout), you should not see it.
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
Just one comment: test_listing_ seen_with_ permission needs a comment at the start of it stating the expected behaviour (it's obvious from the test, but I don't want to have to parse the test to understand what it's testing).
Other than that this is great; r=me.