Merge lp:~sinzui/launchpad/moderated-messages-0 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 16128 | ||||
Proposed branch: | lp:~sinzui/launchpad/moderated-messages-0 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
739 lines (+217/-375) 7 files modified
lib/lp/registry/browser/mailinglists.py (+2/-6) lib/lp/registry/browser/tests/mailinglist-message-views.txt (+0/-74) lib/lp/registry/browser/tests/test_mailinglists.py (+194/-1) lib/lp/registry/interfaces/mailinglist.py (+0/-13) lib/lp/registry/model/mailinglist.py (+4/-33) lib/lp/registry/stories/mailinglists/moderation.txt (+0/-237) lib/lp/registry/tests/test_mailinglist.py (+17/-11) |
||||
To merge this branch: | bzr merge lp:~sinzui/launchpad/moderated-messages-0 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Harding (community) | Approve | ||
Review via email: mp+129013@code.launchpad.net |
Commit message
Fix message moderation timeouts by avoiding the librarian.
Description of the change
The mailing list moderation view can timeout showing a list of messages
even though it shows fewer messages than most listings.
-------
RULES
Pre-
* Lp is calling the librarian for each message to learn which
email address was used to send the message.
* This is not relevant because message approval is based on user,
not email addresses.
* The view is making a link to the lp user, but does extra work
to craft the link to look like an email address.
* HeldMessageDeta
* Only one callsite knows about this cachedproperty,
* Only one callsite knows about the HeldMessageDeta
property.
* Change the view to just use standard links for the the message
author.
* Remove .sender and .email_message from the HeldMessageDetails
class
ADDENDUM
* The query that gets the MessageApproval also precaches the Message,
but not the Person that sent the message. The Person is always
accessed when working with MessageApproval.
QA
* Ask a webops to make you an admin of
https:/
* Visit https:/
* Verify the page loads
* Discard the messages prior to 2012 (the spam)
* verify the page loads.
LINT
lib/
lib/
lib/
lib/
lib/
LoC
This branch removes code that is unneeded by this refactoring.
TEST
./bin/test -vvc -t HeldMessage -t getReviewableMe
./bin/test -vvc -t HeldMessage lp.registry.
IMPLEMENTATION
I updated the view to make a standard Lp link to the sender, which is faster
to format and provides consistency.
lib/
lib/
I updated MailingList.
MessageApproval
use that same user. So the moderated view never asks the librarian
for the sender's email address, and the sender is cached along with the
Lp copy of the message. I removed .sender and .email_message because the
attributes are no longer unused.
lib/
lib/
lib/