From 97557e37b4436ea4bf09ef618e6105951266b838 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 20 Apr 2016 20:14:20 -0700 Subject: Remove (incorrect) re.sub in favor of str.replace. --- Mailman/Handlers/Hold.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Mailman/Handlers') diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index dcc7f963..2faebae1 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -28,7 +28,6 @@ Finally an exception is raised to let the pipeline machinery know that further message handling should stop. """ -import re import email from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage @@ -222,11 +221,9 @@ def hold_for_approval(mlist, msg, msgdata, exc): # translator again, because of the games we play above reason = Utils.wrap(exc.reason_notice()) if isinstance(exc, NonMemberPost) and mlist.nonmember_rejection_notice: - msgdata['rejection_notice'] = Utils.wrap(re.sub( - '%(listowner)s', - mlist.GetOwnerEmail(), - mlist.nonmember_rejection_notice, - )) + msgdata['rejection_notice'] = Utils.wrap( + mlist.nonmember_rejection_notice.replace( + '%(listowner)s', owneraddr)) else: msgdata['rejection_notice'] = Utils.wrap(exc.rejection_notice(mlist)) id = mlist.HoldMessage(msg, reason, msgdata) -- cgit v1.2.3