diff options
| -rw-r--r-- | src/mailman/chains/hold.py | 2 | ||||
| -rw-r--r-- | src/mailman/chains/tests/test_hold.py | 6 | ||||
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/mailman/chains/hold.py b/src/mailman/chains/hold.py index 0509655a2..70f6873f6 100644 --- a/src/mailman/chains/hold.py +++ b/src/mailman/chains/hold.py @@ -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']) log.info('HOLD: %s post from %s held, message-id=%s: %s', mlist.fqdn_listname, msg.sender, msg.get('message-id', 'n/a'), SEMISPACE.join(reasons)) diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py index 1643b6ce3..da87c8d15 100644 --- a/src/mailman/chains/tests/test_hold.py +++ b/src/mailman/chains/tests/test_hold.py @@ -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. 'TEST-REASON-1', 'TEST-REASON-2', ]) + 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 = logfile.read() + self.assertIn('TEST-REASON-1', logged) + self.assertIn('TEST-REASON-2', logged) diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 2f45fd31b..6d20ad019 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -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 + Bompard. Configuration ------------- |
