summaryrefslogtreecommitdiff
path: root/src/mailman/rules/news_moderation.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rules/news_moderation.py')
-rw-r--r--src/mailman/rules/news_moderation.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mailman/rules/news_moderation.py b/src/mailman/rules/news_moderation.py
index a606197f0..3d3d39dc6 100644
--- a/src/mailman/rules/news_moderation.py
+++ b/src/mailman/rules/news_moderation.py
@@ -38,4 +38,11 @@ class ModeratedNewsgroup:
def check(self, mlist, msg, msgdata):
"""See `IRule`."""
- return mlist.newsgroup_moderation == NewsgroupModeration.moderated
+ if mlist.newsgroup_moderation is NewsgroupModeration.moderated:
+ msgdata['moderation_sender'] = msg.sender
+ with _.defer_translation():
+ # This will be translated at the point of use.
+ msgdata.setdefault('moderation_reasons', []).append(
+ _('Post to a moderated newsgroup gateway'))
+ return True
+ return False