diff options
| author | Barry Warsaw | 2016-09-08 21:14:48 +1200 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-08 21:14:48 +1200 |
| commit | 655e04a60c0745664a4b33274f6c8b380428a88f (patch) | |
| tree | 4079c102de7417c14c2d1cab5ff2958bcff3ba26 /src | |
| parent | 447b9bd6df0113ca7e2332d6ad20c01691f3ce07 (diff) | |
| download | mailman-655e04a60c0745664a4b33274f6c8b380428a88f.tar.gz mailman-655e04a60c0745664a4b33274f6c8b380428a88f.tar.zst mailman-655e04a60c0745664a4b33274f6c8b380428a88f.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/app/subscriptions.py | 5 | ||||
| -rw-r--r-- | src/mailman/app/tests/test_unsubscriptions.py | 4 | ||||
| -rw-r--r-- | src/mailman/config/configure.zcml | 4 | ||||
| -rw-r--r-- | src/mailman/runners/docs/command.rst | 8 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py index 52c0ddfbc..b3648e0f9 100644 --- a/src/mailman/app/subscriptions.py +++ b/src/mailman/app/subscriptions.py @@ -356,6 +356,7 @@ class UnSubscriptionWorkflow(Workflow): self.address = None self.user = None self.which = None + self.member = None self._set_token(TokenOwner.no_one) # `subscriber` should be an implementer of IAddress. if IAddress.providedBy(subscriber): @@ -581,7 +582,7 @@ class BaseSubscriptionManager: @public @implementer(ISubscriptionManager) -class SubscriptionWorkflowManager(BaseSubscriptionManager): +class SubscriptionManager(BaseSubscriptionManager): """Handle registrations and confirmations for subscriptions.""" def _get_workflow(self): @@ -601,7 +602,7 @@ class SubscriptionWorkflowManager(BaseSubscriptionManager): @public @implementer(ISubscriptionManager) -class UnsubscriptionWorkflowManager(BaseSubscriptionManager): +class UnsubscriptionManager(BaseSubscriptionManager): """Handle un-subscriptions and confirmations for un-subscriptions.""" def _get_workflow(self): diff --git a/src/mailman/app/tests/test_unsubscriptions.py b/src/mailman/app/tests/test_unsubscriptions.py index 9eec027b0..7a22c86dd 100644 --- a/src/mailman/app/tests/test_unsubscriptions.py +++ b/src/mailman/app/tests/test_unsubscriptions.py @@ -321,8 +321,8 @@ request approval: message['From'], 'test-confirm+{}@example.com'.format(token)) def test_do_confirmation_unsubscribes_user(self): - # Un-subscriptions to the mailing list must be confirmed. Once that's - # done, the user's address is unsubscribed + # Unsubscriptions to the mailing list must be confirmed. Once that's + # done, the user's address is unsubscribed. self._mlist.unsubscription_policy = SubscriptionPolicy.confirm workflow = UnSubscriptionWorkflow(self._mlist, self.anne) list(workflow) diff --git a/src/mailman/config/configure.zcml b/src/mailman/config/configure.zcml index 89d43ac2b..338f02e1c 100644 --- a/src/mailman/config/configure.zcml +++ b/src/mailman/config/configure.zcml @@ -49,14 +49,14 @@ <adapter for="mailman.interfaces.mailinglist.IMailingList" provides="mailman.interfaces.subscriptions.ISubscriptionManager" - factory="mailman.app.subscriptions.SubscriptionWorkflowManager" + factory="mailman.app.subscriptions.SubscriptionManager" name='subscribe' /> <adapter for="mailman.interfaces.mailinglist.IMailingList" provides="mailman.interfaces.subscriptions.ISubscriptionManager" - factory="mailman.app.subscriptions.UnsubscriptionWorkflowManager" + factory="mailman.app.subscriptions.UnsubscriptionManager" name='unsubscribe' /> diff --git a/src/mailman/runners/docs/command.rst b/src/mailman/runners/docs/command.rst index c97e6454c..9e18fe7e0 100644 --- a/src/mailman/runners/docs/command.rst +++ b/src/mailman/runners/docs/command.rst @@ -140,14 +140,16 @@ address, and the other is the results of his email command. >>> len(messages) 2 - >>> from mailman.interfaces.registrar import IRegistrar - >>> registrar = IRegistrar(mlist) + >>> from mailman.interfaces.subscriptions import ISubscriptionManager + >>> from zope.component import getAdapter + + >>> manager = getAdapter(mlist, ISubscriptionManager, 'subscribe') >>> for item in messages: ... subject = item.msg['subject'] ... print('Subject:', subject) ... if 'confirm' in str(subject): ... token = str(subject).split()[1].strip() - ... new_token, token_owner, member = registrar.confirm(token) + ... new_token, token_owner, member = manager.confirm(token) ... assert new_token is None, 'Confirmation failed' Subject: The results of your email commands Subject: confirm ... |
