Commit eb322697 authored by Aurélien Bompard's avatar Aurélien Bompard Committed by Barry Warsaw

Fix the logging of the moderation reasons

parent 6c75191a
......@@ -247,7 +247,7 @@ also appear in the first line of the body of the reply.""")),
# Log the held message. Log messages are not translated, so recast
# the reasons in the English.
with _.using('en'):
reasons = _compose_reasons(msgdata)
reasons = msgdata.get('moderation_reasons', ['N/A'])'HOLD: %s post from %s held, message-id=%s: %s',
mlist.fqdn_listname, msg.sender,
msg.get('message-id', 'n/a'), SEMISPACE.join(reasons))
......@@ -31,7 +31,7 @@ from mailman.core.chains import process as process_chain
from mailman.interfaces.autorespond import IAutoResponseSet, Response
from mailman.interfaces.usermanager import IUserManager
from mailman.testing.helpers import (
configuration, get_queue_messages,
configuration, get_queue_messages, LogFileMark,
specialized_message_from_string as mfs)
from mailman.testing.layers import ConfigLayer
from zope.component import getUtility
......@@ -115,6 +115,7 @@ A message body.
logfile = LogFileMark('mailman.vette')
process_chain(self._mlist, msg, msgdata, start_chain='hold')
messages = get_queue_messages('virgin')
self.assertEqual(len(messages), 2)
......@@ -131,3 +132,6 @@ A message body.
self.assertIn(' TEST-REASON-2', payloads['owner'])
self.assertIn(' TEST-REASON-1', payloads['sender'])
self.assertIn(' TEST-REASON-2', payloads['sender'])
logged =
self.assertIn('TEST-REASON-1', logged)
self.assertIn('TEST-REASON-2', logged)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment