Merge lp:~sinzui/launchpad/fast-contact-via-web into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | j.c.sackett on 2012-11-29 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 16324 | ||||
| Proposed branch: | lp:~sinzui/launchpad/fast-contact-via-web | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
55 lines (+14/-3) 2 files modified
lib/lp/registry/browser/person.py (+5/-1) lib/lp/registry/browser/tests/test_person_contact.py (+9/-2) |
||||
| To merge this branch: | bzr merge lp:~sinzui/launchpad/fast-contact-via-web | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-11-29 | Approve on 2012-11-29 | |
|
Review via email:
|
|||
Commit Message
Do not load all the team members to learn the count of who will be contacted.
Description of the Change
OOPS-6c1d4799395a99f0d86db9e729eaab5d shows a timeout caused by lost
time in a python call related to getMembersWithP
link to contact team members needs to know the count, but it is getting
all 18363 members -- they are not needed. A recent change to fix an oops
contact teams without admins changed the call to get the count to use a
cached property...but this property is not already loaded, and in fact
only needs to be called when sending the member email messages.
-------
RULES
Pre-
* Revert the change to ContactViaWebNo
so that the TO_MEMBERS check uses:
recipient
* Keep the change for TO_ADMINS.
QA
As a member of https:/
* Visit https:/
* Verify the page loads.
LINT
lib/
lib/
TEST
./bin/test -vvc lp.registry.
IMPLEMENTATION
I reverted the check for TO_MEMBERS which was much faster than the
needless loading of all the members. I forgot that pages that link to
the contact-team page use the ContactViaWebNo
get the link description, they do not need the members, so they were not
already cached. I added a test to verify that instantiating the
recipient set and calling length makes less than three db calls -- it
currently checks the user's
relationship to the team, then gets the member count.
lib/
lib/

This looks good. Thanks, Curtis.