diff options
| author | Abhilash Raj | 2016-07-30 21:06:57 -0700 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-01 06:55:09 -0400 |
| commit | 88f349900ea9afea30186c3c9f0f399ff69f6c4a (patch) | |
| tree | 984a31ab8be58871bacf4a5821ddc611ac4586fe /src/mailman/commands/eml_membership.py | |
| parent | c23519b5262fd264ed0f9e5bc23b901ed7eee632 (diff) | |
| download | mailman-88f349900ea9afea30186c3c9f0f399ff69f6c4a.tar.gz mailman-88f349900ea9afea30186c3c9f0f399ff69f6c4a.tar.zst mailman-88f349900ea9afea30186c3c9f0f399ff69f6c4a.zip | |
Diffstat (limited to 'src/mailman/commands/eml_membership.py')
| -rw-r--r-- | src/mailman/commands/eml_membership.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mailman/commands/eml_membership.py b/src/mailman/commands/eml_membership.py index 7d3704e14..af391fd5b 100644 --- a/src/mailman/commands/eml_membership.py +++ b/src/mailman/commands/eml_membership.py @@ -22,16 +22,16 @@ from mailman import public from mailman.core.i18n import _ from mailman.interfaces.command import ContinueProcessing, IEmailCommand from mailman.interfaces.member import DeliveryMode, MemberRole -from mailman.interfaces.registrar import IRegistrar +from mailman.interfaces.workflowmanager import IWorkflowManager from mailman.interfaces.subscriptions import ISubscriptionService from mailman.interfaces.usermanager import IUserManager -from zope.component import getUtility +from zope.component import getUtility, getAdapter from zope.interface import implementer def match_subscriber(email, display_name): # Return something matching the email which should be used as the - # subscriber by the IRegistrar interface. + # subscriber by the IWorkflowManager interface. manager = getUtility(IUserManager) # Is there a user with a preferred address matching the email? user = manager.get_user(email) @@ -101,7 +101,8 @@ used. print(_('$person is already a member'), file=results) return ContinueProcessing.yes subscriber = match_subscriber(email, display_name) - IRegistrar(mlist).register(subscriber) + getAdapter(mlist, + IWorkflowManager, name='subscribe').register(subscriber) print(_('Confirmation email sent to $person'), file=results) return ContinueProcessing.yes @@ -186,9 +187,12 @@ You may be asked to confirm your request.""") '$self.name: $email is not a member of $mlist.fqdn_listname'), file=results) return ContinueProcessing.no - member.unsubscribe() - person = formataddr((user.display_name, email)) # noqa: F841 - print(_('$person left $mlist.fqdn_listname'), file=results) + getAdapter(mlist, + IWorkflowManager, name='unsubscribe').register(user_address) + # member.unsubscribe() + person = formataddr((user.display_name, email)) # noqa + print(_('Confirmation email sent to $person to leave' + ' $mlist.fqdn_listname'), file=results) return ContinueProcessing.yes |
