Merge lp:~edwin-grubbs/launchpad/bug-655802-person-vocabulary-timeout into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11764 |
Proposed branch: | lp:~edwin-grubbs/launchpad/bug-655802-person-vocabulary-timeout |
Merge into: | lp:launchpad |
Diff against target: |
185 lines (+66/-30) 2 files modified
lib/lp/registry/tests/test_person_vocabularies.py (+46/-0) lib/lp/registry/vocabularies.py (+20/-30) |
To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-655802-person-vocabulary-timeout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+38905@code.launchpad.net |
Description of the change
Summary
-------
Fixes soft timeouts when the AJAX Picker searches the
ValidPersonOrTe
Implementation details
-------
Rewrote query to remove private_
query. Don't check the Account table, since the person record is
considered broken if the account status is active, and it doesn't have a
preferred email address. The EmailAddress is actually queried twice.
First, to search all VALIDATED and PREFERRED email addresses for certain
text. Secondly, to verify that any non-team has a PREFERRED email.
lib/
Added test to verify that the extra_clause is getting applied to the
query in _doSearch() when that method is passed in a search term.
Previously, the the picker would allow you to select a private team
as a member of itself. Later, it would fail because the __contains__()
method constructs a different query without a search term.
lib/
Tests
-----
./bin/test -vv -t test_person_
Demo and Q/A
------------
* Open http://
* Click on the "Add member" and search for "John Arbash Meinel".
* It should not timeout.
Thanks for working on this. I think this is good to land, but I have a one question/remark. I do not understand why the test is on the LaunchpadFuncti onalLayer? I see database objects, but no library objects in the test. I think the test will run on the DatabaseFunctio nalLayer.