summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAurélien Bompard2015-09-15 19:02:16 +0200
committerBarry Warsaw2015-09-23 20:49:12 -0400
commiteb322697bc6fdb16bd70492f6a1bea7b78424f4c (patch)
tree769abed38078ea572b6355f66d6dd7186b47b174 /src
parent6c75191a230474d51505ba3269f14b9093b35863 (diff)
downloadmailman-eb322697bc6fdb16bd70492f6a1bea7b78424f4c.tar.gz
mailman-eb322697bc6fdb16bd70492f6a1bea7b78424f4c.tar.zst
mailman-eb322697bc6fdb16bd70492f6a1bea7b78424f4c.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/chains/hold.py2
-rw-r--r--src/mailman/chains/tests/test_hold.py6
2 files changed, 6 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..2db91f520 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,
+ 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.
'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)