Merge lp:~deryck/launchpad/displayname-private-team-oops-634847 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Deryck Hodge |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11617 |
Proposed branch: | lp:~deryck/launchpad/displayname-private-team-oops-634847 |
Merge into: | lp:launchpad |
Diff against target: |
87 lines (+50/-2) 2 files modified
lib/lp/bugs/model/bug.py (+7/-2) lib/lp/bugs/tests/test_bug.py (+43/-0) |
To merge this branch: | bzr merge lp:~deryck/launchpad/displayname-private-team-oops-634847 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+36199@code.launchpad.net |
Commit message
Fix an OOPS when trying to sort on displayname for bug subscribers.
Description of the change
This work fixes the OOPS reported in bug 634847, where a comment was
not being allowed to post to a bug. The error was because a team was
subscribed that was private, and getAlsoNotified
blowing up trying to access a forbidden attribute ("displayname") for
sorting.
This branch adds tests to ensure we can list subscribers when one is
private and fixes the couple spots in the code where this was a
problem. The fix I chose was to use lambda to get an object that was
not security proxied and then pass the displayname attribute as the
sort key. This allows the list that is returned to retain security
proxied objects.
Cheers,
deryck