summaryrefslogtreecommitdiff
path: root/src/mailman/commands/eml_membership.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-02-29 20:21:48 -0500
committerBarry Warsaw2012-02-29 20:21:48 -0500
commitbd95333e95f6867bc9b5d8daade2cfdc240d7f90 (patch)
tree6fe0e76283e1dd6995dc5688615158be3d05f714 /src/mailman/commands/eml_membership.py
parentf58b82cd6955f0d5d295853bf421f8f2f8b4ce83 (diff)
downloadmailman-bd95333e95f6867bc9b5d8daade2cfdc240d7f90.tar.gz
mailman-bd95333e95f6867bc9b5d8daade2cfdc240d7f90.tar.zst
mailman-bd95333e95f6867bc9b5d8daade2cfdc240d7f90.zip
Diffstat (limited to 'src/mailman/commands/eml_membership.py')
-rw-r--r--src/mailman/commands/eml_membership.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mailman/commands/eml_membership.py b/src/mailman/commands/eml_membership.py
index 4f46cfac7..88f7d5722 100644
--- a/src/mailman/commands/eml_membership.py
+++ b/src/mailman/commands/eml_membership.py
@@ -34,8 +34,9 @@ from zope.interface import implements
from mailman.core.i18n import _
from mailman.interfaces.command import ContinueProcessing, IEmailCommand
-from mailman.interfaces.member import DeliveryMode
+from mailman.interfaces.member import DeliveryMode, MemberRole
from mailman.interfaces.registrar import IRegistrar
+from mailman.interfaces.subscriptions import ISubscriptionService
from mailman.interfaces.usermanager import IUserManager
@@ -81,9 +82,14 @@ example:
return ContinueProcessing.yes
joins.add(address)
results.joins = joins
- getUtility(IRegistrar).register(mlist, address, real_name)
+ members = getUtility(ISubscriptionService).find_members(address)
person = formataddr((real_name, address))
- print >> results, _('Confirmation email sent to $person')
+ if len(members) > 0 and members[0].role is MemberRole.member:
+ assert(members[0].address.email == address)
+ print >> results, _('$person is already a member')
+ else:
+ getUtility(IRegistrar).register(mlist, address, real_name)
+ print >> results, _('Confirmation email sent to $person')
return ContinueProcessing.yes
def _parse_arguments(self, arguments):