From 08f457799cd36349a4fd22642f4c05b4eabb306d Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 15 Apr 2015 22:51:39 -0400 Subject: Plumb the subscription policy through the REST API. --- src/mailman/commands/eml_confirm.py | 11 ++++++++++- src/mailman/commands/tests/test_confirm.py | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands') diff --git a/src/mailman/commands/eml_confirm.py b/src/mailman/commands/eml_confirm.py index 077fab9a6..ddf0db0e2 100644 --- a/src/mailman/commands/eml_confirm.py +++ b/src/mailman/commands/eml_confirm.py @@ -25,6 +25,7 @@ __all__ = [ from mailman.core.i18n import _ from mailman.interfaces.command import ContinueProcessing, IEmailCommand from mailman.interfaces.registrar import IRegistrar +from mailman.interfaces.subscriptions import TokenOwner from zope.interface import implementer @@ -53,7 +54,15 @@ class Confirm: tokens.add(token) results.confirms = tokens try: - succeeded = (IRegistrar(mlist).confirm(token) is None) + token, token_owner, member = IRegistrar(mlist).confirm(token) + if token is None: + assert token_owner is TokenOwner.no_one, token_owner + assert member is not None, member + succeeded = True + else: + assert token_owner is not TokenOwner.no_one, token_owner + assert member is None, member + succeeded = False except LookupError: # The token must not exist in the database. succeeded = False diff --git a/src/mailman/commands/tests/test_confirm.py b/src/mailman/commands/tests/test_confirm.py index 98a26bf7d..e980141b0 100644 --- a/src/mailman/commands/tests/test_confirm.py +++ b/src/mailman/commands/tests/test_confirm.py @@ -46,7 +46,8 @@ class TestConfirm(unittest.TestCase): self._mlist = create_list('test@example.com') anne = getUtility(IUserManager).create_address( 'anne@example.com', 'Anne Person') - self._token = IRegistrar(self._mlist).register(anne) + self._token, token_owner, member = IRegistrar(self._mlist).register( + anne) self._command = Confirm() # Clear the virgin queue. get_queue_messages('virgin') -- cgit v1.2.3-70-g09d2 From d48b501bb1e1b6970e8cc93e184e4e4da357e1a3 Mon Sep 17 00:00:00 2001 From: Sumana Harihareswara Date: Sun, 19 Apr 2015 21:36:21 -0400 Subject: typofixes --- src/mailman/commands/cli_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands') diff --git a/src/mailman/commands/cli_control.py b/src/mailman/commands/cli_control.py index f58005e0f..5bd9ef1e3 100644 --- a/src/mailman/commands/cli_control.py +++ b/src/mailman/commands/cli_control.py @@ -56,7 +56,7 @@ class Start: default=False, action='store_true', help=_("""\ If the master watcher finds an existing master lock, it will - normally exit with an error message. With this option,the master + normally exit with an error message. With this option, the master will perform an extra level of checking. If a process matching the host/pid described in the lock file is running, the master will still exit, requiring you to manually clean up the lock. But @@ -78,7 +78,7 @@ class Start: This flag is not recommended for normal production environments. Note though, that if you run with -u and are not in the mailman - group, you may have permission problems, such as begin unable to + group, you may have permission problems, such as being unable to delete a list's archives through the web. Tough luck!""")) command_parser.add_argument( '-q', '--quiet', -- cgit v1.2.3-70-g09d2