Merge lp://qastaging/~deryck/launchpad/less-restrictive-assign-someone-else-603281 into lp://qastaging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Brad Crittenden | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11479 | ||||
Proposed branch: | lp://qastaging/~deryck/launchpad/less-restrictive-assign-someone-else-603281 | ||||
Merge into: | lp://qastaging/launchpad | ||||
Diff against target: |
621 lines (+185/-144) 6 files modified
lib/lp/bugs/browser/tests/test_bugtask.py (+20/-3) lib/lp/bugs/doc/bugtask.txt (+0/-74) lib/lp/bugs/interfaces/bugtask.py (+4/-3) lib/lp/bugs/model/bugtask.py (+46/-30) lib/lp/bugs/stories/bugtask-management/xx-change-assignee.txt (+13/-1) lib/lp/bugs/tests/test_bugtask.py (+102/-33) |
||||
To merge this branch: | bzr merge lp://qastaging/~deryck/launchpad/less-restrictive-assign-someone-else-603281 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | Approve | ||
Review via email: mp+33824@code.qastaging.launchpad.net |
Commit message
Allow anyone to set bugtask assignee if there is not a defined bug supervisor.
Description of the change
This branch fixes bug 603281, which notes that when we changed
permissions for who can assign a bug to someone else that we made that a
bit too strict for projects without a bug supervisor.
This branch fixes that by lifting the restrictions if a bug supervisor
is not set for a project/distro. This means that projects that haven't
yet set a bug supervisor will be able to assign bugs without having to
set a bug supervisor. The functionality returns to what it once was.
But for projects that have a bug supervisor, the new requirements will
remain, i.e. that you cannot assign a bug to someone else.
This includes a test update and then the couple line change to
BugTask.
this method, nothing had to be changed with the JS widget.
Hi Deryck,
Thanks for making this fix rolling back some restrictions.
In userCanSetAnyAs signee, I think the test would read better if you factored out the test for 'user is None' and return False immediately. So I'm suggesting (I hope formatting is preserved)
def userCanSetAnyAs signee( self, user): ILaunchpadCeleb rities) bug_supervisor is None:
user. inTeam( self.pillar. bug_supervisor) or
user. inTeam( self.pillar. owner) or
user. inTeam( self.pillar. driver) or
(self. distroseries is not None and
user. inTeam( self.distroseri es.driver) ) or
(self. productseries is not None and
user. inTeam( self.productser ies.driver) ) or
user. inTeam( celebrities. admin) bug_importer)
"""See `IBugTask`."""
celebrities = getUtility(
if user is None:
return False
elif self.pillar.
return True
else:
return (
or user == celebrities.
The technique you provided in setBugSupervisor of having the base class provide two alternatives for the subclasses to choose is very interesting. I've never seen that before.