From 96757fbf7535f17288c5a7e755a8cb0c1afd7b1b Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 4 Dec 2016 23:18:34 +0000 Subject: Remove to_moderators --- src/mailman/chains/hold.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mailman/chains/hold.py b/src/mailman/chains/hold.py index 42fed66a6..a44bd6a0c 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.""")), nmsg.attach(text) nmsg.attach(MIMEMessage(msg)) nmsg.attach(MIMEMessage(dmsg)) - nmsg.send(mlist, to_moderators=True) + nmsg.send(mlist) # Log the held message. Log messages are not translated, so recast # the reasons in the English. with _.using('en'): -- cgit v1.2.3-70-g09d2 From 28777416b09e397e69864caf0bbdd93a3f1aa1e2 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 4 Dec 2016 23:21:18 +0000 Subject: Rrmove to_moderators. --- src/mailman/app/subscriptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py index f88a967c2..52c90ded1 100644 --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -287,7 +287,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon): msg = UserNotification( self.mlist.owner_address, self.mlist.owner_address, subject, text, self.mlist.preferred_language) - msg.send(self.mlist, to_moderators=True) + msg.send(self.mlist) # The workflow must stop running here. raise StopIteration @@ -435,7 +435,7 @@ class UnSubscriptionWorkflow(_SubscriptionWorkflowCommon): msg = UserNotification( self.mlist.owner_address, self.mlist.owner_address, subject, text, self.mlist.preferred_language) - msg.send(self.mlist, to_moderators=True) + msg.send(self.mlist) # The workflow must stop running here raise StopIteration -- cgit v1.2.3-70-g09d2 From 0846595ab8f75afda49fcdf35abe87b609af55d5 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 4 Dec 2016 23:22:36 +0000 Subject: Remove to_moderators. --- src/mailman/app/moderator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mailman/app/moderator.py b/src/mailman/app/moderator.py index 9d3856f33..109138686 100644 --- a/src/mailman/app/moderator.py +++ b/src/mailman/app/moderator.py @@ -204,7 +204,7 @@ def hold_unsubscription(mlist, email): msg = UserNotification( mlist.owner_address, mlist.owner_address, subject, text, mlist.preferred_language) - msg.send(mlist, to_moderators=True) + msg.send(mlist) return request_id -- cgit v1.2.3-70-g09d2 From 5b92dc47dd00da03111c17fa317328324ae677b8 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 4 Dec 2016 15:51:41 -0800 Subject: Fix tests for test-owner instead of moderator's address. --- src/mailman/app/tests/test_moderation.py | 2 +- src/mailman/app/tests/test_subscriptions.py | 2 +- src/mailman/chains/tests/test_hold.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py index bb3958cd7..9dfc012c7 100644 --- a/src/mailman/app/tests/test_moderation.py +++ b/src/mailman/app/tests/test_moderation.py @@ -178,7 +178,7 @@ class TestUnsubscription(unittest.TestCase): break else: raise AssertionError('No moderator email found') - self.assertEqual(item.msgdata['recipients'], {'bart@example.com'}) + self.assertEqual(item.msgdata['recipients'], {'test-owner@example.com'}) self.assertEqual( item.msg['subject'], 'New unsubscription request from Test by anne@example.org') diff --git a/src/mailman/app/tests/test_subscriptions.py b/src/mailman/app/tests/test_subscriptions.py index b960b7904..91354ef8a 100644 --- a/src/mailman/app/tests/test_subscriptions.py +++ b/src/mailman/app/tests/test_subscriptions.py @@ -451,7 +451,7 @@ class TestSubscriptionWorkflow(unittest.TestCase): break else: raise AssertionError('No moderator email found') - self.assertEqual(item.msgdata['recipients'], {'bart@example.com'}) + self.assertEqual(item.msgdata['recipients'], {'test-owner@example.com'}) message = items[0].msg self.assertEqual(message['From'], 'test-owner@example.com') self.assertEqual(message['To'], 'test-owner@example.com') diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py index 6686c4777..02ca08932 100644 --- a/src/mailman/chains/tests/test_hold.py +++ b/src/mailman/chains/tests/test_hold.py @@ -173,8 +173,8 @@ A message body. # delivery to the moderators. items = get_queue_messages('virgin', expected_count=1) msgdata = items[0].msgdata - # Should get sent to moderators. - self.assertEqual(msgdata['recipients'], {'bart@example.com'}) + # Should get sent to -owner address. + self.assertEqual(msgdata['recipients'], {'test-owner@example.com'}) # Ensure that the subject looks correct in the postauth.txt. msg = items[0].msg value = None -- cgit v1.2.3-70-g09d2 From ab20aacc47fea1fd77f1ea69a2244793da7de080 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 4 Dec 2016 16:03:54 -0800 Subject: Fix flake8 errors. --- src/mailman/app/tests/test_moderation.py | 3 ++- src/mailman/app/tests/test_subscriptions.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py index 9dfc012c7..90377bf72 100644 --- a/src/mailman/app/tests/test_moderation.py +++ b/src/mailman/app/tests/test_moderation.py @@ -178,7 +178,8 @@ class TestUnsubscription(unittest.TestCase): break else: raise AssertionError('No moderator email found') - self.assertEqual(item.msgdata['recipients'], {'test-owner@example.com'}) + self.assertEqual( + item.msgdata['recipients'], {'test-owner@example.com'}) self.assertEqual( item.msg['subject'], 'New unsubscription request from Test by anne@example.org') diff --git a/src/mailman/app/tests/test_subscriptions.py b/src/mailman/app/tests/test_subscriptions.py index 91354ef8a..0f4809fd5 100644 --- a/src/mailman/app/tests/test_subscriptions.py +++ b/src/mailman/app/tests/test_subscriptions.py @@ -451,7 +451,8 @@ class TestSubscriptionWorkflow(unittest.TestCase): break else: raise AssertionError('No moderator email found') - self.assertEqual(item.msgdata['recipients'], {'test-owner@example.com'}) + self.assertEqual( + item.msgdata['recipients'], {'test-owner@example.com'}) message = items[0].msg self.assertEqual(message['From'], 'test-owner@example.com') self.assertEqual(message['To'], 'test-owner@example.com') -- cgit v1.2.3-70-g09d2 From ab34404b41ad5898b409a00c489841ece89f36b6 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 29 Dec 2016 16:17:34 -0500 Subject: Remove support for to_moderators. Remove a NEWS entry which is no longer applicable. --- src/mailman/docs/NEWS.rst | 2 -- src/mailman/email/message.py | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 1841f8fb7..093c9bd0e 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -97,8 +97,6 @@ Bugs (Closes: #283) * Remove the digest mbox files after the digests are sent. Given by Aurélien Bompard. (Closes: #259) - * Messages sent to the list's moderators now include the actual recipient - addresses. Given by Tom Briles. (Closes: #68) * Transmit the moderation reason and expose it in the REST API as the ``reason`` attribute. Given by Aurélien Bompard. * Don't return a 500 error from the REST API when trying to handle a held diff --git a/src/mailman/email/message.py b/src/mailman/email/message.py index da2ce837f..307afbc7b 100644 --- a/src/mailman/email/message.py +++ b/src/mailman/email/message.py @@ -133,7 +133,7 @@ class UserNotification(Message): self['To'] = recipients self.recipients = set([recipients]) - def send(self, mlist, *, add_precedence=True, to_moderators=False, **_kws): + def send(self, mlist, *, add_precedence=True, **_kws): """Sends the message by enqueuing it to the 'virgin' queue. This is used for all internally crafted messages. @@ -143,9 +143,6 @@ class UserNotification(Message): :param add_precedence: Flag indicating whether a `Precedence: bulk` header should be added to the message or not. :type add_precedence: bool - :param to_moderators: Flag indicating whether the message should be - sent to the list's moderators instead of the list's membership. - :type to_moderators: bool This function also accepts arbitrary keyword arguments. The key/value pairs for **kws is added to the metadata dictionary associated with @@ -163,12 +160,6 @@ class UserNotification(Message): # don't override an existing Precedence: header. if 'precedence' not in self and add_precedence: self['Precedence'] = 'bulk' - if to_moderators: - self.recipients = set( - member.address.email - for member in mlist.moderators.members - if member.delivery_status is DeliveryStatus.enabled) - self['To'] = COMMASPACE.join(self.recipients) self._enqueue(mlist, **_kws) def _enqueue(self, mlist, **_kws): -- cgit v1.2.3-70-g09d2 From 351515f4b47be1fc3b353cbef988879f5c0d3db2 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 29 Dec 2016 19:42:15 -0500 Subject: Remove an unused import. --- src/mailman/email/message.py | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mailman/email/message.py b/src/mailman/email/message.py index 307afbc7b..da341d1b7 100644 --- a/src/mailman/email/message.py +++ b/src/mailman/email/message.py @@ -30,7 +30,6 @@ import email.utils from email.header import Header from email.mime.multipart import MIMEMultipart from mailman.config import config -from mailman.interfaces.member import DeliveryStatus from public import public -- cgit v1.2.3-70-g09d2 From 635993f670ba1e820f0ff6be292be07ffe48cae8 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 30 Dec 2016 05:11:43 +0000 Subject: Fix typos --- src/mailman/database/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mailman/database/types.py b/src/mailman/database/types.py index 10b826e7c..28a99043e 100644 --- a/src/mailman/database/types.py +++ b/src/mailman/database/types.py @@ -121,6 +121,6 @@ def compile_sa_unicode_large(element, compiler, **kw): return 'VARCHAR(510) COLLATE utf8_bin' -@compiles(SAUnicode) -def defalt_sa_unicode_large(element, compiler, **kw): +@compiles(SAUnicodeLarge) +def default_sa_unicode_large(element, compiler, **kw): return compiler.visit_unicode(element, **kw) -- cgit v1.2.3-70-g09d2 From 435db9e0ad03ae92dc23778dfb37cae6b27ce798 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 30 Dec 2016 05:55:58 +0000 Subject: Yet another typo in database/types.py --- src/mailman/database/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mailman/database/types.py b/src/mailman/database/types.py index 28a99043e..b5fa0626f 100644 --- a/src/mailman/database/types.py +++ b/src/mailman/database/types.py @@ -97,7 +97,7 @@ class SAUnicode(TypeDecorator): @compiles(SAUnicode) def default_sa_unicode(element, compiler, **kw): - return compiler.visit_Unicode(element, **kw) + return compiler.visit_unicode(element, **kw) @compiles(SAUnicode, 'mysql') -- cgit v1.2.3-70-g09d2