Merge lp://staging/~edwin-grubbs/launchpad/bug-568390-cyclic-membership-error into lp://staging/launchpad
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11110 |
Proposed branch: | lp://staging/~edwin-grubbs/launchpad/bug-568390-cyclic-membership-error |
Merge into: | lp://staging/launchpad |
Diff against target: |
157 lines (+115/-7) 3 files modified
lib/lp/registry/browser/objectreassignment.py (+5/-6) lib/lp/registry/browser/person.py (+27/-1) lib/lp/registry/browser/tests/team-reassignment-view.txt (+83/-0) |
To merge this branch: | bzr merge lp://staging/~edwin-grubbs/launchpad/bug-568390-cyclic-membership-error |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Review via email: mp+29407@code.staging.launchpad.net |
Description of the change
Summary
-------
The TeamReassignmen
new owner as a member of that team. The view now disipays an error if
this creates a cyclical team membership, so that the model won't raise
an exception.
Implementation details
-------
The ObjectReassignm
it shouldn't be used to set a custom error message, so I changed it to
validateOwner(). This gets called at the end of
ObjectReassignm
the user is not using an existing team. isValidOwner() does not appear
to be used in any of the other subclasses of ObjectReassignm
lib/
lib/
lib/
Tests
-----
./bin/test -vv -t team-reassignme
Demo and Q/A
------------
* Open https:/
* Create three new teams.
* Add teams as members, so A is a member of B is a member of C.
* Open https:/
* Try to make C the owner of A.
* It should display an error that this will cause a cyclical team
membership.
<rockstar> EdwinGrubbs, maybe validateOwner's abstract method should return False or raise NotImplementedE rror. ew.validate( ).
<EdwinGrubbs> rockstar: it's not required that validateOwner() be overridden. The vocabulary normally does a good enough job. This is the only subclass that actually does override it.
<EdwinGrubbs> so raising NotImplementedError isn't necessary, and returning false would be meaningless.
<rockstar> EdwinGrubbs, pass seems like it's very unopinionated
<EdwinGrubbs> rockstar: it's no different than LaunchpadFormVi
<rockstar> EdwinGrubbs, okay.