Commit 0e2e4b4e authored by Barry Warsaw's avatar Barry Warsaw

The logging of moderation reasons has been fixed. Given by Aurélien Bompard.

parents 6c75191a a5dc59ef
Pipeline #146455 passed with stage
......@@ -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,
LogFileMark, configuration, get_queue_messages,
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)
......@@ -38,6 +38,8 @@ Bugs
* Bulk emails are now decorated with headers and footers. Given by Aurélien
Bompard. (Closes #145)
* Core no longer depends on the standalone `mock` module. (Closes: #146)
* The logging of moderation reasons has been fixed. Given by Aurélien
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