diff options
| author | Barry Warsaw | 2016-08-30 21:02:06 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-01 06:55:09 -0400 |
| commit | 84c0f9532ae20d0f5ee8a8ecd9a92e42925b174b (patch) | |
| tree | 8df7ada1e3eedfeca584062fbc3e5507e1b70ed7 /src/mailman/model | |
| parent | 975b5e0af2759e5fb7c6d10ddd4923127b7ec442 (diff) | |
| download | mailman-84c0f9532ae20d0f5ee8a8ecd9a92e42925b174b.tar.gz mailman-84c0f9532ae20d0f5ee8a8ecd9a92e42925b174b.tar.zst mailman-84c0f9532ae20d0f5ee8a8ecd9a92e42925b174b.zip | |
Checkpointing
Diffstat (limited to 'src/mailman/model')
| -rw-r--r-- | src/mailman/model/mailinglist.py | 8 | ||||
| -rw-r--r-- | src/mailman/model/tests/test_mailinglist.py | 2 | ||||
| -rw-r--r-- | src/mailman/model/tests/test_workflow.py | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/mailman/model/mailinglist.py b/src/mailman/model/mailinglist.py index 396b8ed3d..4e76e61c1 100644 --- a/src/mailman/model/mailinglist.py +++ b/src/mailman/model/mailinglist.py @@ -457,11 +457,7 @@ class MailingList(Model): Member.role == role, Member.list_id == self._list_id, Member._user == subscriber).first() - - if member: - return True - else: - return False + return member is not None @dbconnection def subscribe(self, store, subscriber, role=MemberRole.member): @@ -470,10 +466,8 @@ class MailingList(Model): email = subscriber.email elif IUser.providedBy(subscriber): email = subscriber.preferred_address.email - if self.is_subscribed(subscriber, role): raise AlreadySubscribedError(self.fqdn_listname, email, role) - member = Member(role=role, list_id=self._list_id, subscriber=subscriber) diff --git a/src/mailman/model/tests/test_mailinglist.py b/src/mailman/model/tests/test_mailinglist.py index 3e3c5814c..0a5c8a5e9 100644 --- a/src/mailman/model/tests/test_mailinglist.py +++ b/src/mailman/model/tests/test_mailinglist.py @@ -17,7 +17,6 @@ """Test MailingLists and related model objects..""" -import pdb import unittest from mailman.app.lifecycle import create_list @@ -106,6 +105,7 @@ class TestMailingList(unittest.TestCase): self._mlist.subscribe(address) self.assertEqual(True, self._mlist.is_subscribed(address)) + class TestListArchiver(unittest.TestCase): layer = ConfigLayer diff --git a/src/mailman/model/tests/test_workflow.py b/src/mailman/model/tests/test_workflow.py index afcba613b..2b6a593a9 100644 --- a/src/mailman/model/tests/test_workflow.py +++ b/src/mailman/model/tests/test_workflow.py @@ -124,7 +124,8 @@ class TestWorkflow(unittest.TestCase): self.assertEqual(self._manager.count, 1) def test_discard(self): - # Discard some workflow state. This is use by IWorkflowManager.discard(). + # Discard some workflow state. This is use by + # IWorkflowManager.discard(). self._manager.save('ant', 'token', 'one') self._manager.save('bee', 'token', 'two') self._manager.save('ant', 'nekot', 'three') |
