summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-08-16 17:31:18 +0000
committerbwarsaw2002-08-16 17:31:18 +0000
commit02f7e083969726da25194d45c8df48f89a22f07d (patch)
treee0d9f826841516c239a21031a022716510b1e975
parentb6eb28831f257bb067c6fdef254ed9bb0caa32c9 (diff)
downloadmailman-02f7e083969726da25194d45c8df48f89a22f07d.tar.gz
mailman-02f7e083969726da25194d45c8df48f89a22f07d.tar.zst
mailman-02f7e083969726da25194d45c8df48f89a22f07d.zip
-rw-r--r--Mailman/Cgi/confirm.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/Mailman/Cgi/confirm.py b/Mailman/Cgi/confirm.py
index e40861311..5c8327aea 100644
--- a/Mailman/Cgi/confirm.py
+++ b/Mailman/Cgi/confirm.py
@@ -600,25 +600,34 @@ def heldmsg_prompt(mlist, doc, cookie, id):
table.AddRow([Center(Bold(FontAttr(title, size='+1')))])
table.AddCellInfo(table.GetCurrentRowIndex(), 0,
colspan=2, bgcolor=mm_cfg.WEB_HEADER_COLOR)
-
# Blarg. The list must be locked in order to interact with the ListAdmin
- # database, even for read-only.
- # See the comment in admin.py about the need for the signal
- # handler.
+ # database, even for read-only. See the comment in admin.py about the
+ # need for the signal handler.
def sigterm_handler(signum, frame, mlist=mlist):
mlist.Unlock()
sys.exit(0)
-
+ # Get the record, but watch for KeyErrors which mean the admin has already
+ # disposed of this message.
mlist.Lock()
try:
- ign, sender, msgsubject, givenreason, ign, ign = mlist.GetRecord(id)
+ try:
+ data = mlist.GetRecord(id)
+ except KeyError:
+ data = None
finally:
mlist.Unlock()
+ if data is None:
+ bad_confirmation(doc, _("""The held message you were referred to has
+ already been handled by the list administrator."""))
+ return
+
+ # Now set the language to the sender's preferred.
lang = mlist.getMemberLanguage(sender)
i18n.set_language(lang)
doc.set_language(lang)
-
+ # Unpack the data and present the confirmation message
+ ign, sender, msgsubject, givenreason, ign, ign = data
subject = Utils.websafe(msgsubject)
reason = Utils.websafe(givenreason)
listname = mlist.real_name