Merge lp:~jcsackett/launchpad/merge-ppas-697685 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12195 |
Proposed branch: | lp:~jcsackett/launchpad/merge-ppas-697685 |
Merge into: | lp:launchpad |
Diff against target: |
183 lines (+106/-53) 2 files modified
lib/lp/registry/browser/peoplemerge.py (+77/-53) lib/lp/registry/browser/tests/test_peoplemerge.py (+29/-0) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/merge-ppas-697685 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+45450@code.launchpad.net |
Commit message
[r=adeuring]
Description of the change
Summary
=======
For a merge to happen, the duplicate entity (team or person) being merged can't have PPAs. This was already prevented from happening in the AdminMerge views, but not in the RequestPeopleMe
Proposed Fix
============
Add the validation step used in AdminMerge views to the other view.
Preimplementation Talk
=======
Spoke with Curtis Hovey about the validation needs.
Implementation
==============
lib/lp/
-------
A new class, ValidatingMergeView was created that contains the validation step used in AdminMergeBaseView. AdminMergeBaseView and RequestPeopleMe
Additionally, the step in validation checking for PPAs now first checks that the dupe person is not None; if the dupe is None, the error is handled by the vocabularies governing merges, so this is safe to do, and prevents an error when the validator tries to find PPAs for NoneType.
Lastly, RequestPeopleMe
lib/lp/
-------
Create a new test case to test that duplicate people with ppas cause an error on the RequestPeopleMe
Tests
=====
bin/test -t peoplemerge
Demo & QA
=========
Attempt to merge a person with a PPA into the account you're logged into through +requestmerge. It should provide an error saying you need to delete the PPA.
Obviously, do this on qastaging or launchpad.dev :-P
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/