Merge lp:~thumper/launchpad/package-branch-edit-owner into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jonathan Lange |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10925 |
Proposed branch: | lp:~thumper/launchpad/package-branch-edit-owner |
Merge into: | lp:launchpad |
Diff against target: |
243 lines (+103/-28) 5 files modified
lib/lp/code/browser/branch.py (+23/-0) lib/lp/code/stories/branches/xx-branch-edit.txt (+47/-1) lib/lp/code/tests/helpers.py (+28/-2) lib/lp/code/tests/test_branch.py (+4/-23) lib/lp/registry/vocabularies.py (+1/-2) |
To merge this branch: | bzr merge lp:~thumper/launchpad/package-branch-edit-owner |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange (community) | Approve | ||
Review via email: mp+25291@code.launchpad.net |
Commit message
Allow branch editors who are not in the owner team to edit the branch details without grabbing ownership of the branch.
Description of the change
There is a weird edge case in the editing of a branch where the editor has upload permission on the source package, and this gives the user edit permission on the official source package branch. In these cases the current owner of the branch wasn't in the vocabulary that was used for the widget to set the owner, so the default was set to the first value (the user).
Now when this edge case occurs we add the current branch owner in at the start of the vocabulary used in this situation.
pre-impl call: rockstar
tests: xx-branch-edit.txt
As a drive by fix, I noticed that the vocabularies for IPerson were duplicating the code of unique_displayname, so I fixed it.
Hey Tim,
Weird edge case. Thanks for fixing it up.
* I wish you didn't add to the doctest, and instead added some real unit tests. Don't feel obliged to do anything about this wish.
* If there were a function like get_allowed_ owners( branch, editor) (or a method branch. get_allowed_ owners( editor) ) that returned a list of potential owners, then this wouldn't be an edge case. I guess what I mean is, why did you decide to fix this at the view level rather than the model level?
* The big block of code you add in the doctest could do with some basic prose explanation, e.g. "Create an official branch owned by ~ubuntu-branches, and an editor who has nothing to do with ~ubuntu-branches but is still allowed to edit the branch."
You only need to do something about the last point as far as I'm concerned. Would very much appreciate your thoughts on the first two though.
jml