Merge lp:~deryck/launchpad/person-latest-bugs-listings-921366 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Aaron Bentley on 2012-03-28 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 15041 | ||||
| Proposed branch: | lp:~deryck/launchpad/person-latest-bugs-listings-921366 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
373 lines (+123/-52) 3 files modified
lib/lp/bugs/browser/bugtask.py (+34/-32) lib/lp/bugs/browser/tests/test_bugtask.py (+77/-16) lib/lp/bugs/feed/bug.py (+12/-4) |
||||
| To merge this branch: | bzr merge lp:~deryck/launchpad/person-latest-bugs-listings-921366 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2012-03-28 | Approve on 2012-03-28 | |
|
Review via email:
|
|||
Commit Message
Do not add bug listing data to JSON cache for bug feeds.
Description of the Change
This branch fixes bug 921366, which notes that we have an OOPS for Person bugs feeds. This happens because feeds initialize a delegate view, which causes the bug task listing code to not be able to get at the view name in the same way as a normal view. I discussed this bug in pre-imp discussions with both abentley and flacoste and settled on completely avoiding adding bug list data to the cache in the case of feeds. Populating the cache is extra work we really don't need to do for feeds, regardless of the view name ambiguity it introduces.
So this branch checks to see if we're in a feed view or not, and if not, then we add the data to the cache. I've also added a number of tests to ensure this works for all bug targets. browser/
The bugs feed classes had been creating this delegate view inside another method, and I pulled view creation out to a separate method to make this easier to test. Finally, the project group test assigned the target to self.projectgroup rather than self.target, and I changed this test to match the other tests.
make lint doesn't complain.

I'd prefer to have getFeedViewCache as a function so that we don't need an extra class, but this is good to land either way.