aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2009-01-02 18:40:28 -0800
committerMark Sapiro <mark@msapiro.net>2009-01-02 18:40:28 -0800
commit2154e5dc03be61c10c7fb9157600fc19feffce86 (patch)
tree800c90810bcc5032bd7d29031543347af0e1ecf4 /Mailman
parent4269de985663736b04bf3ecbf002eb5ab68435d4 (diff)
downloadmailman2-2154e5dc03be61c10c7fb9157600fc19feffce86.tar.gz
mailman2-2154e5dc03be61c10c7fb9157600fc19feffce86.tar.xz
mailman2-2154e5dc03be61c10c7fb9157600fc19feffce86.zip
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".
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Cgi/admindb.py17
-rw-r--r--Mailman/Utils.py4
2 files changed, 10 insertions, 11 deletions
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('<hr>')
# 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 = ''
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 8401d0f0..847d1a82 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2008 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
@@ -266,7 +266,7 @@ def ScriptURL(target, web_page_url=None, absolute=False):
fullpath = os.environ.get('SCRIPT_NAME', '') + \
os.environ.get('PATH_INFO', '')
baseurl = urlparse.urlparse(web_page_url)[2]
- if not absolute and fullpath.endswith(baseurl):
+ if not absolute and fullpath.startswith(baseurl):
# Use relative addressing
fullpath = fullpath[len(baseurl):]
i = fullpath.find('?')