From 2154e5dc03be61c10c7fb9157600fc19feffce86 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 2 Jan 2009 18:40:28 -0800 Subject: Mailman/Utils.py - Fixed a long standing error that stopped relative hrefs from being generated for links on Mailman's web pages. Mailman/Cgi/admindb.py - Changed the admindb interface so that when messages are rejected from the summary page, the reject reason is the rejection message from the Errors.HoldMessage subclass instead of the generic "No reason given". --- Mailman/Cgi/admindb.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Mailman/Cgi/admindb.py') diff --git a/Mailman/Cgi/admindb.py b/Mailman/Cgi/admindb.py index 75cc66a0..a20763f1 100644 --- a/Mailman/Cgi/admindb.py +++ b/Mailman/Cgi/admindb.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -554,12 +554,8 @@ def show_detailed_requests(mlist, form): def show_post_requests(mlist, id, info, total, count, form): - # For backwards compatibility with pre 2.0beta3 - if len(info) == 5: - ptime, sender, subject, reason, filename = info - msgdata = {} - else: - ptime, sender, subject, reason, filename, msgdata = info + # Mailman.ListAdmin.__handlepost no longer tests for pre 2.0beta3 + ptime, sender, subject, reason, filename, msgdata = info form.AddItem('
') # Header shown on each held posting (including count of total) msg = _('Posting Held for Approval') @@ -709,10 +705,12 @@ def process_form(mlist, doc, cgidata): preserve = actions.get('senderpreserve', 0) forward = actions.get('senderforward', 0) forwardaddr = actions.get('senderforwardto', '') - comment = _('No reason given') bysender = helds_by_sender(mlist) for id in bysender.get(sender, []): try: + msgdata = mlist.GetRecord(id)[5] + comment = msgdata.get('rejection_notice', + _('[No explanation given]')) mlist.HandleRequest(id, action, comment, preserve, forward, forwardaddr) except (KeyError, Errors.LostHeldMessage): @@ -771,7 +769,8 @@ def process_form(mlist, doc, cgidata): forwardaddrkey = 'forward-addr-%d' % request_id bankey = 'ban-%d' % request_id # Defaults - comment = _('[No reason given]') + msgdata = mlist.GetRecord(request_id)[5] + comment = msgdata.get('rejection_notice', _('[No explanation given]')) preserve = 0 forward = 0 forwardaddr = '' -- cgit v1.2.3