summaryrefslogtreecommitdiff
path: root/src/mailman/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/commands')
-rw-r--r--src/mailman/commands/eml_confirm.py2
-rw-r--r--src/mailman/commands/eml_membership.py3
-rw-r--r--src/mailman/commands/tests/test_confirm.py6
3 files changed, 6 insertions, 5 deletions
diff --git a/src/mailman/commands/eml_confirm.py b/src/mailman/commands/eml_confirm.py
index a28a3f728..4c6039aad 100644
--- a/src/mailman/commands/eml_confirm.py
+++ b/src/mailman/commands/eml_confirm.py
@@ -53,7 +53,7 @@ class Confirm:
return ContinueProcessing.yes
tokens.add(token)
results.confirms = tokens
- succeeded = getUtility(IRegistrar).confirm(token)
+ succeeded = IRegistrar(mlist).confirm(token)
if succeeded:
print(_('Confirmed'), file=results)
return ContinueProcessing.yes
diff --git a/src/mailman/commands/eml_membership.py b/src/mailman/commands/eml_membership.py
index 059b9b634..b42116b74 100644
--- a/src/mailman/commands/eml_membership.py
+++ b/src/mailman/commands/eml_membership.py
@@ -86,8 +86,7 @@ used.
if len(members) > 0:
print(_('$person is already a member'), file=results)
else:
- getUtility(IRegistrar).register(mlist, address,
- display_name, delivery_mode)
+ IRegistrar(mlist).register(address)
print(_('Confirmation email sent to $person'), file=results)
return ContinueProcessing.yes
diff --git a/src/mailman/commands/tests/test_confirm.py b/src/mailman/commands/tests/test_confirm.py
index dd168454f..2f6a8088f 100644
--- a/src/mailman/commands/tests/test_confirm.py
+++ b/src/mailman/commands/tests/test_confirm.py
@@ -29,6 +29,7 @@ from mailman.commands.eml_confirm import Confirm
from mailman.email.message import Message
from mailman.interfaces.command import ContinueProcessing
from mailman.interfaces.registrar import IRegistrar
+from mailman.interfaces.usermanager import IUserManager
from mailman.runners.command import Results
from mailman.testing.helpers import get_queue_messages, reset_the_world
from mailman.testing.layers import ConfigLayer
@@ -43,8 +44,9 @@ class TestConfirm(unittest.TestCase):
def setUp(self):
self._mlist = create_list('test@example.com')
- self._token = getUtility(IRegistrar).register(
- self._mlist, 'anne@example.com', 'Anne Person')
+ anne = getUtility(IUserManager).create_address(
+ 'anne@example.com', 'Anne Person')
+ self._token = IRegistrar(self._mlist).register(anne)
self._command = Confirm()
# Clear the virgin queue.
get_queue_messages('virgin')