diff options
| author | Barry Warsaw | 2007-06-18 10:50:23 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-06-18 10:50:23 -0400 |
| commit | 511a33778c4195c4abca7c58aa6917e6a77059b6 (patch) | |
| tree | 5bffc7a5793a8247310294ac86931741e73b1fc5 /Mailman/Handlers | |
| parent | f0e3b3934d5d458cadd814eeae07277b58650180 (diff) | |
| download | mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.tar.gz mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.tar.zst mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.zip | |
Remove both the model and interface for RosterSets. These are no longer used
or necessary in the current data model.
Convert the test_handlers.py Python test to an acknowledge.txt doctest, and
make the Acknowledge.py handler work with the new data model. There are a few
XXX comments left in here due to the fact that the web stuff is a total hack
in the current branch currently.
Added IMailingListWeb methods and properties to the MailingList model class:
web_host and script_url().
Work out how IMembers will expose the lookup-order based preferences. By
getting the attribute IMember.preferences you can see exactly the preferences
overridden by this member. To use the lookup order, use
IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember
interface now provides the properties directly and access through this
mechanism supports lookup order with definitive preference values.
Also added IMember.unsubscribe() which does the obvious, and
IMember.options_url() which is a total hack for providing a url (but not the
ultimately right one) for the user's option page.
Refactor the model's roster classes. Also added IRoster.get_member() method
with efficient queries to return the right results. Make
AdministratorRoster.members more efficient due to a better query.
Update the membership.txt doctest to eliminate a chance ordering effect, and
also to test finding members with .get_member(). The clean up section uses
the new .unsubscribe() method.
Diffstat (limited to 'Mailman/Handlers')
| -rw-r--r-- | Mailman/Handlers/Acknowledge.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Mailman/Handlers/Acknowledge.py b/Mailman/Handlers/Acknowledge.py index d02920cde..078c3ac92 100644 --- a/Mailman/Handlers/Acknowledge.py +++ b/Mailman/Handlers/Acknowledge.py @@ -36,30 +36,30 @@ __i18n_templates__ = True def process(mlist, msg, msgdata): # Extract the sender's address and find them in the user database sender = msgdata.get('original_sender', msg.get_sender()) - try: - ack = mlist.getMemberOption(sender, config.AcknowledgePosts) - if not ack: - return - except Errors.NotAMemberError: + member = mlist.members.get_member(sender) + if member is None: + return + ack = member.acknowledge_posts + if not ack: return # Okay, they want acknowledgement of their post. Give them their original # subject. BAW: do we want to use the decoded header? origsubj = msgdata.get('origsubj', msg.get('subject', _('(no subject)'))) # Get the user's preferred language - lang = msgdata.get('lang', mlist.getMemberLanguage(sender)) + lang = msgdata.get('lang', member.preferred_language) # Now get the acknowledgement template realname = mlist.real_name text = Utils.maketext( 'postack.txt', {'subject' : Utils.oneline(origsubj, Utils.GetCharSet(lang)), 'listname' : realname, - 'listinfo_url': mlist.GetScriptURL('listinfo', absolute=1), - 'optionsurl' : mlist.GetOptionsURL(sender, absolute=1), - }, lang=lang, mlist=mlist, raw=1) + 'listinfo_url': mlist.script_url('listinfo'), + 'optionsurl' : member.options_url, + }, lang=lang, mlist=mlist, raw=True) # Craft the outgoing message, with all headers and attributes # necessary for general delivery. Then enqueue it to the outgoing # queue. - subject = _('$realname post acknowledgement') - usermsg = Message.UserNotification(sender, mlist.GetBouncesEmail(), + subject = _('$realname post acknowledgment') + usermsg = Message.UserNotification(sender, mlist.bounces_address, subject, text, lang) usermsg.send(mlist) |
