------------------------------------------------------------
revno: 1644
fixes bug: https://launchpad.net/bugs/1572330
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Tue 2016-04-19 15:53:54 -0700
message:
  Use nonmember_rejection_notice as the default reject reason for a held
  nonmember post.
modified:
  Mailman/Handlers/Hold.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/Hold.py'
--- Mailman/Handlers/Hold.py	2011-02-07 20:09:54 +0000
+++ Mailman/Handlers/Hold.py	2016-04-19 22:53:54 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2011 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -28,6 +28,7 @@
 message handling should stop.
 """
 
+import re
 import email
 from email.MIMEText import MIMEText
 from email.MIMEMessage import MIMEMessage
@@ -220,7 +221,14 @@
     # We need to send both the reason and the rejection notice through the
     # translator again, because of the games we play above
     reason = Utils.wrap(exc.reason_notice())
-    msgdata['rejection_notice'] = Utils.wrap(exc.rejection_notice(mlist))
+    if isinstance(exc, NonMemberPost) and mlist.nonmember_rejection_notice:
+        msgdata['rejection_notice'] = Utils.wrap(re.sub(
+                                      '%(listowner)s',
+                                      mlist.GetOwnerEmail(),
+                                      mlist.nonmember_rejection_notice,
+                                      ))
+    else:
+        msgdata['rejection_notice'] = Utils.wrap(exc.rejection_notice(mlist))
     id = mlist.HoldMessage(msg, reason, msgdata)
     # Now we need to craft and send a message to the list admin so they can
     # deal with the held message.

=== modified file 'NEWS'
--- NEWS	2016-04-17 18:50:44 +0000
+++ NEWS	2016-04-19 22:53:54 +0000
@@ -5,6 +5,15 @@
 
 Here is a history of user visible changes to Mailman.
 
+2.1.2 (xx-xxx-xxxx)
+ 
+  New Features
+
+    - A list's nonmember_rejection_notice attribute will now be the default
+      rejection reason for a held non-member post in addition to it's prior
+      role as the reson for an automatically rejected non-member post.
+      (LP: #1572330)
+
 2.1.22 (17-Apr-2016)
 
   i18n

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to