summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman/app/docs/chains.rst1
-rw-r--r--src/mailman/app/membership.py1
-rw-r--r--src/mailman/app/registrar.py6
-rw-r--r--src/mailman/app/tests/test_bounces.py11
-rw-r--r--src/mailman/app/tests/test_notifications.py20
-rw-r--r--src/mailman/chains/docs/moderation.rst9
-rw-r--r--src/mailman/commands/docs/members.rst19
-rw-r--r--src/mailman/commands/tests/test_import.py61
-rw-r--r--src/mailman/docs/NEWS.rst4
-rw-r--r--src/mailman/model/docs/registration.rst6
-rw-r--r--src/mailman/mta/tests/test_delivery.py5
-rw-r--r--src/mailman/rest/docs/membership.rst13
-rw-r--r--src/mailman/rest/docs/moderation.rst8
-rw-r--r--src/mailman/rules/docs/moderation.rst7
-rw-r--r--src/mailman/runners/docs/incoming.rst4
-rw-r--r--src/mailman/runners/docs/outgoing.rst15
-rw-r--r--src/mailman/testing/config-with-instances.pckbin0 -> 4667 bytes
-rw-r--r--src/mailman/testing/helpers.py26
18 files changed, 150 insertions, 66 deletions
diff --git a/src/mailman/app/docs/chains.rst b/src/mailman/app/docs/chains.rst
index 1feecbd68..a79999de0 100644
--- a/src/mailman/app/docs/chains.rst
+++ b/src/mailman/app/docs/chains.rst
@@ -302,6 +302,7 @@ This message will end up in the `pipeline` queue.
>>> from mailman.testing.helpers import subscribe
>>> subscribe(mlist, 'Anne')
+ <Member: aperson@example.com on test@example.com as MemberRole.member>
>>> with event_subscribers(print_msgid):
... process(mlist, msg, {})
diff --git a/src/mailman/app/membership.py b/src/mailman/app/membership.py
index 757a87393..85a6cba08 100644
--- a/src/mailman/app/membership.py
+++ b/src/mailman/app/membership.py
@@ -64,7 +64,6 @@ def add_member(mlist, record, role=MemberRole.member):
# Make sure there is a user linked with the given address.
user_manager = getUtility(IUserManager)
user = user_manager.make_user(record.email, record.display_name)
- # Encrypt the password using the currently selected hash scheme.
user.preferences.preferred_language = record.language
# Subscribe the address, not the user.
# We're looking for two versions of the email address, the case
diff --git a/src/mailman/app/registrar.py b/src/mailman/app/registrar.py
index 252a7eb9b..2544e233c 100644
--- a/src/mailman/app/registrar.py
+++ b/src/mailman/app/registrar.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
-"""Implementation of the IUserRegistrar interface."""
+"""Implementation of the IRegistrar interface."""
__all__ = [
'Registrar',
@@ -55,7 +55,7 @@ class Registrar:
"""Handle registrations and confirmations for subscriptions."""
def register(self, mlist, email, display_name=None, delivery_mode=None):
- """See `IUserRegistrar`."""
+ """See `IRegistrar`."""
if delivery_mode is None:
delivery_mode = DeliveryMode.regular
# First, do validation on the email address. If the address is
@@ -76,7 +76,7 @@ class Registrar:
return token
def confirm(self, token):
- """See `IUserRegistrar`."""
+ """See `IRegistrar`."""
# For convenience
pendable = getUtility(IPendings).confirm(token)
if pendable is None:
diff --git a/src/mailman/app/tests/test_bounces.py b/src/mailman/app/tests/test_bounces.py
index 119fcf7f9..ef77d88a0 100644
--- a/src/mailman/app/tests/test_bounces.py
+++ b/src/mailman/app/tests/test_bounces.py
@@ -44,7 +44,7 @@ from mailman.interfaces.pending import IPendings
from mailman.interfaces.usermanager import IUserManager
from mailman.testing.helpers import (
LogFileMark, get_queue_messages, specialized_message_from_string as mfs,
- subscribe_ex)
+ subscribe)
from mailman.testing.layers import ConfigLayer
from zope.component import getUtility
@@ -193,8 +193,7 @@ class TestSendProbe(unittest.TestCase):
def setUp(self):
self._mlist = create_list('test@example.com')
self._mlist.send_welcome_message = False
- self._member = subscribe_ex(
- self._mlist, 'Anne', email='anne@example.com')
+ self._member = subscribe(self._mlist, 'Anne', email='anne@example.com')
self._msg = mfs("""\
From: bouncer@example.com
To: anne@example.com
@@ -284,8 +283,7 @@ class TestSendProbeNonEnglish(unittest.TestCase):
def setUp(self):
self._mlist = create_list('test@example.com')
- self._member = subscribe_ex(
- self._mlist, 'Anne', email='anne@example.com')
+ self._member = subscribe(self._mlist, 'Anne', email='anne@example.com')
self._msg = mfs("""\
From: bouncer@example.com
To: anne@example.com
@@ -349,8 +347,7 @@ class TestProbe(unittest.TestCase):
def setUp(self):
self._mlist = create_list('test@example.com')
self._mlist.send_welcome_message = False
- self._member = subscribe_ex(
- self._mlist, 'Anne', email='anne@example.com')
+ self._member = subscribe(self._mlist, 'Anne', email='anne@example.com')
self._msg = mfs("""\
From: bouncer@example.com
To: anne@example.com
diff --git a/src/mailman/app/tests/test_notifications.py b/src/mailman/app/tests/test_notifications.py
index 19c11d0a4..e01969201 100644
--- a/src/mailman/app/tests/test_notifications.py
+++ b/src/mailman/app/tests/test_notifications.py
@@ -32,7 +32,7 @@ from mailman.config import config
from mailman.interfaces.languages import ILanguageManager
from mailman.interfaces.member import MemberRole
from mailman.interfaces.usermanager import IUserManager
-from mailman.testing.helpers import get_queue_messages, subscribe, subscribe_ex
+from mailman.testing.helpers import get_queue_messages, subscribe
from mailman.testing.layers import ConfigLayer
from zope.component import getUtility
@@ -104,7 +104,7 @@ Welcome to the Test List mailing list.
# Add the xx language and subscribe Anne using it.
manager = getUtility(ILanguageManager)
manager.add('xx', 'us-ascii', 'Xlandia')
- # We can't use the subscribe_ex() helper because that would send the
+ # We can't use the subscribe() helper because that would send the
# welcome message before we set the member's preferred language.
address = getUtility(IUserManager).create_address(
'anne@example.com', 'Anne Person')
@@ -122,29 +122,23 @@ Welcome to the Test List mailing list.
def test_no_welcome_message_to_owners(self):
# Welcome messages go only to mailing list members, not to owners.
- member = subscribe_ex(
- self._mlist, 'Anne', MemberRole.owner, email='anne@example.com')
- member.preferences.preferred_language = 'xx'
+ subscribe(self._mlist, 'Anne', MemberRole.owner, 'anne@example.com')
# There is no welcome message in the virgin queue.
messages = get_queue_messages('virgin')
self.assertEqual(len(messages), 0)
def test_no_welcome_message_to_nonmembers(self):
# Welcome messages go only to mailing list members, not to nonmembers.
- member = subscribe_ex(
- self._mlist, 'Anne', MemberRole.nonmember,
- email='anne@example.com')
- member.preferences.preferred_language = 'xx'
+ subscribe(self._mlist, 'Anne', MemberRole.nonmember,
+ 'anne@example.com')
# There is no welcome message in the virgin queue.
messages = get_queue_messages('virgin')
self.assertEqual(len(messages), 0)
def test_no_welcome_message_to_moderators(self):
# Welcome messages go only to mailing list members, not to moderators.
- member = subscribe_ex(
- self._mlist, 'Anne', MemberRole.moderator,
- email='anne@example.com')
- member.preferences.preferred_language = 'xx'
+ subscribe(self._mlist, 'Anne', MemberRole.moderator,
+ 'anne@example.com')
# There is no welcome message in the virgin queue.
messages = get_queue_messages('virgin')
self.assertEqual(len(messages), 0)
diff --git a/src/mailman/chains/docs/moderation.rst b/src/mailman/chains/docs/moderation.rst
index fefc4f543..c239ec7a6 100644
--- a/src/mailman/chains/docs/moderation.rst
+++ b/src/mailman/chains/docs/moderation.rst
@@ -31,12 +31,13 @@ Posts by list members are moderated if the member's moderation action is not
deferred. The default setting for the moderation action of new members is
determined by the mailing list's settings. By default, a mailing list is not
set to moderate new member postings.
+::
- >>> from mailman.testing.helpers import subscribe_ex
- >>> member = subscribe_ex(mlist, 'Anne', email='anne@example.com')
+ >>> from mailman.testing.helpers import subscribe
+ >>> member = subscribe(mlist, 'Anne', email='anne@example.com')
>>> member
- <Member: Anne Person <anne@example.com>
- on test@example.com as MemberRole.member>
+ <Member: Anne Person <anne@example.com> on test@example.com
+ as MemberRole.member>
>>> print(member.moderation_action)
Action.defer
diff --git a/src/mailman/commands/docs/members.rst b/src/mailman/commands/docs/members.rst
index 0f4a4afa1..86e5c3ceb 100644
--- a/src/mailman/commands/docs/members.rst
+++ b/src/mailman/commands/docs/members.rst
@@ -36,7 +36,11 @@ Once the mailing list add some members, they will be displayed.
>>> from mailman.testing.helpers import subscribe
>>> subscribe(mlist1, 'Anne', email='anne@example.com')
+ <Member: Anne Person <anne@example.com> on test1@example.com
+ as MemberRole.member>
>>> subscribe(mlist1, 'Bart', email='bart@example.com')
+ <Member: Bart Person <bart@example.com> on test1@example.com
+ as MemberRole.member>
>>> command.process(args)
Anne Person <anne@example.com>
Bart Person <bart@example.com>
@@ -45,6 +49,8 @@ Members are displayed in alphabetical order based on their address.
::
>>> subscribe(mlist1, 'Anne', email='anne@aaaxample.com')
+ <Member: Anne Person <anne@aaaxample.com> on test1@example.com
+ as MemberRole.member>
>>> command.process(args)
Anne Person <anne@aaaxample.com>
Anne Person <anne@example.com>
@@ -125,16 +131,17 @@ status is enabled...
::
>>> from mailman.interfaces.member import DeliveryStatus
- >>> from mailman.testing.helpers import subscribe_ex
+
>>> member = mlist1.members.get_member('anne@aaaxample.com')
>>> member.preferences.delivery_status = DeliveryStatus.by_moderator
>>> member = mlist1.members.get_member('bart@example.com')
>>> member.preferences.delivery_status = DeliveryStatus.by_user
- >>> member = subscribe_ex(mlist1, 'Cris', email='cris@example.com')
+
+ >>> member = subscribe(mlist1, 'Cris', email='cris@example.com')
>>> member.preferences.delivery_status = DeliveryStatus.unknown
- >>> member = subscribe_ex(mlist1, 'Dave', email='dave@example.com')
+ >>> member = subscribe(mlist1, 'Dave', email='dave@example.com')
>>> member.preferences.delivery_status = DeliveryStatus.enabled
- >>> member = subscribe_ex(mlist1, 'Elly', email='elly@example.com')
+ >>> member = subscribe(mlist1, 'Elle', email='elle@example.com')
>>> member.preferences.delivery_status = DeliveryStatus.by_bounces
>>> args.nomail = 'enabled'
@@ -158,7 +165,7 @@ status is enabled...
>>> args.nomail = 'bybounces'
>>> command.process(args)
- Elly Person <elly@example.com>
+ Elle Person <elle@example.com>
...or for unknown (legacy) reasons.
@@ -174,7 +181,7 @@ You can also display all members who have delivery disabled for any reason.
Anne Person <anne@aaaxample.com>
Bart Person <bart@example.com>
Cris Person <cris@example.com>
- Elly Person <elly@example.com>
+ Elle Person <elle@example.com>
# Reset for following tests.
>>> args.nomail = None
diff --git a/src/mailman/commands/tests/test_import.py b/src/mailman/commands/tests/test_import.py
new file mode 100644
index 000000000..96f955e52
--- /dev/null
+++ b/src/mailman/commands/tests/test_import.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2015 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+"""Test the `mailman import21` subcommand."""
+
+__all__ = [
+ 'TestImport',
+ ]
+
+
+import unittest
+
+from mailman.app.lifecycle import create_list
+from mailman.commands.cli_import import Import21
+from mailman.testing.layers import ConfigLayer
+from mock import patch
+from pkg_resources import resource_filename
+
+
+
+class FakeArgs:
+ listname = ['test@example.com']
+ pickle_file = [
+ resource_filename('mailman.testing', 'config-with-instances.pck'),
+ ]
+
+
+
+class TestImport(unittest.TestCase):
+ layer = ConfigLayer
+
+ def setUp(self):
+ self.command = Import21()
+ self.args = FakeArgs()
+ self.mlist = create_list('test@example.com')
+
+ @patch('mailman.commands.cli_import.import_config_pck')
+ def test_process_pickle_with_bounce_info(self, import_config_pck):
+ # The sample data contains Mailman 2 bounce info, represented as
+ # _BounceInfo instances. We throw these away when importing to
+ # Mailman 3, but we have to fake the instance's classes, otherwise
+ # unpickling the dictionaries will fail.
+ try:
+ self.command.process(self.args)
+ except ImportError as error:
+ self.fail('The pickle failed loading: {}'.format(error))
+ self.assertTrue(import_config_pck.called)
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 77c45375d..191e667a9 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -49,6 +49,10 @@ Documentation
REST
----
+ * **Backward incompatible change**: The JSON representation for pending
+ mailing list subscription hold now no longer includes the ``password``
+ key. Also, the ``address`` key has been renamed ``email`` for consistent
+ terminology and other usage.
* You can now view the contents of, inject messages into, and delete messages
from the various queue directories via the ``<api>/queues`` resource.
* You can now DELETE an address. If the address is linked to a user, the
diff --git a/src/mailman/model/docs/registration.rst b/src/mailman/model/docs/registration.rst
index 55e99f23a..47f9f951d 100644
--- a/src/mailman/model/docs/registration.rst
+++ b/src/mailman/model/docs/registration.rst
@@ -290,9 +290,9 @@ confirm method will just return False.
>>> registrar.confirm(bytes(b'no token'))
False
-Likewise, if you try to confirm, through the `IUserRegistrar` interface, a
-token that doesn't match a registration event, you will get ``None``.
-However, the pending event matched with that token will still be removed.
+Likewise, if you try to confirm, through the `IRegistrar` interface, a token
+that doesn't match a registration event, you will get ``None``. However, the
+pending event matched with that token will still be removed.
::
>>> from mailman.interfaces.pending import IPendable
diff --git a/src/mailman/mta/tests/test_delivery.py b/src/mailman/mta/tests/test_delivery.py
index 0ac8489a2..2c744f21d 100644
--- a/src/mailman/mta/tests/test_delivery.py
+++ b/src/mailman/mta/tests/test_delivery.py
@@ -32,7 +32,7 @@ from mailman.config import config
from mailman.interfaces.mailinglist import Personalization
from mailman.mta.deliver import Deliver
from mailman.testing.helpers import (
- specialized_message_from_string as mfs, subscribe_ex)
+ specialized_message_from_string as mfs, subscribe)
from mailman.testing.layers import ConfigLayer
@@ -61,8 +61,7 @@ class TestIndividualDelivery(unittest.TestCase):
self._mlist = create_list('test@example.com')
self._mlist.personalize = Personalization.individual
# Make Anne a member of this mailing list.
- self._anne = subscribe_ex(
- self._mlist, 'Anne', email='anne@example.org')
+ self._anne = subscribe(self._mlist, 'Anne', email='anne@example.org')
# Clear out any results from the previous test.
del _deliveries[:]
self._msg = mfs("""\
diff --git a/src/mailman/rest/docs/membership.rst b/src/mailman/rest/docs/membership.rst
index 0343f40a1..3cb83a0c8 100644
--- a/src/mailman/rest/docs/membership.rst
+++ b/src/mailman/rest/docs/membership.rst
@@ -39,6 +39,9 @@ the REST interface.
>>> from mailman.testing.helpers import subscribe
>>> subscribe(bee, 'Bart')
+ <Member: Bart Person <bperson@example.com> on bee@example.com
+ as MemberRole.member>
+
>>> dump_json('http://localhost:9001/3.0/members')
entry 0:
address: http://localhost:9001/3.0/addresses/bperson@example.com
@@ -69,8 +72,12 @@ Bart's specific membership can be accessed directly:
When Cris also joins the mailing list, her subscription is also available via
the REST interface.
+::
>>> subscribe(bee, 'Cris')
+ <Member: Cris Person <cperson@example.com> on bee@example.com
+ as MemberRole.member>
+
>>> dump_json('http://localhost:9001/3.0/members')
entry 0:
address: http://localhost:9001/3.0/addresses/bperson@example.com
@@ -101,6 +108,8 @@ subscribes, she is returned first.
::
>>> subscribe(bee, 'Anna')
+ <Member: Anna Person <aperson@example.com> on bee@example.com
+ as MemberRole.member>
>>> dump_json('http://localhost:9001/3.0/members')
entry 0:
@@ -143,7 +152,11 @@ address. Anna and Cris subscribe to this new mailing list.
>>> ant = create_list('ant@example.com')
>>> subscribe(ant, 'Anna')
+ <Member: Anna Person <aperson@example.com> on ant@example.com
+ as MemberRole.member>
>>> subscribe(ant, 'Cris')
+ <Member: Cris Person <cperson@example.com> on ant@example.com
+ as MemberRole.member>
User ids are different than member ids.
diff --git a/src/mailman/rest/docs/moderation.rst b/src/mailman/rest/docs/moderation.rst
index bdb8d9f1c..0a9fd59a8 100644
--- a/src/mailman/rest/docs/moderation.rst
+++ b/src/mailman/rest/docs/moderation.rst
@@ -216,13 +216,15 @@ requests.
When Anne tries to subscribe to the Ant list, her subscription is held for
moderator approval.
+::
>>> from mailman.app.moderator import hold_subscription
>>> from mailman.interfaces.member import DeliveryMode
>>> from mailman.interfaces.subscriptions import RequestRecord
- >>> sub_req_id = hold_subscription(ant,
- ... RequestRecord('anne@example.com', 'Anne Person',
- ... DeliveryMode.regular, 'en'))
+
+ >>> sub_req_id = hold_subscription(
+ ... ant, RequestRecord('anne@example.com', 'Anne Person',
+ ... DeliveryMode.regular, 'en'))
>>> transaction.commit()
The subscription request is available from the mailing list.
diff --git a/src/mailman/rules/docs/moderation.rst b/src/mailman/rules/docs/moderation.rst
index 5631c882d..401004f34 100644
--- a/src/mailman/rules/docs/moderation.rst
+++ b/src/mailman/rules/docs/moderation.rst
@@ -26,6 +26,9 @@ postings are not moderated.
>>> from mailman.testing.helpers import subscribe
>>> subscribe(mlist, 'Anne')
+ <Member: Anne Person <aperson@example.com> on test@example.com
+ as MemberRole.member>
+
>>> member = mlist.members.get_member('aperson@example.com')
>>> print(member.moderation_action)
Action.defer
@@ -66,9 +69,13 @@ postings are held for moderator approval.
nonmember-moderation
Bart, who is not a member of the mailing list, sends a message to the list.
+::
>>> from mailman.interfaces.member import MemberRole
>>> subscribe(mlist, 'Bart', MemberRole.nonmember)
+ <Member: Bart Person <bperson@example.com> on test@example.com
+ as MemberRole.nonmember>
+
>>> nonmember = mlist.nonmembers.get_member('bperson@example.com')
>>> print(nonmember.moderation_action)
Action.hold
diff --git a/src/mailman/runners/docs/incoming.rst b/src/mailman/runners/docs/incoming.rst
index d4fb65c85..fa425980b 100644
--- a/src/mailman/runners/docs/incoming.rst
+++ b/src/mailman/runners/docs/incoming.rst
@@ -89,9 +89,13 @@ Accepted messages
We have a message that is going to be sent to the mailing list. Once Anne is
a member of the mailing list, this message is so perfectly fine for posting
that it will be accepted and forward to the pipeline queue.
+::
>>> from mailman.testing.helpers import subscribe
>>> subscribe(mlist, 'Anne')
+ <Member: Anne Person <aperson@example.com> on test@example.com
+ as MemberRole.member>
+
>>> msg = message_from_string("""\
... From: aperson@example.com
... To: test@example.com
diff --git a/src/mailman/runners/docs/outgoing.rst b/src/mailman/runners/docs/outgoing.rst
index 598622775..cc544d6eb 100644
--- a/src/mailman/runners/docs/outgoing.rst
+++ b/src/mailman/runners/docs/outgoing.rst
@@ -15,9 +15,18 @@ move messages to the 'retry queue' for handling delivery failures.
>>> from mailman.testing.helpers import subscribe
>>> mlist = create_list('test@example.com')
- >>> subscribe(mlist, 'Anne', email='aperson@example.com')
- >>> subscribe(mlist, 'Bart', email='bperson@example.com')
- >>> subscribe(mlist, 'Cris', email='cperson@example.com')
+ >>> from mailman.testing.helpers import subscribe
+ >>> subscribe(mlist, 'Anne')
+ <Member: Anne Person <aperson@example.com>
+ on test@example.com as MemberRole.member>
+
+ >>> subscribe(mlist, 'Bart')
+ <Member: Bart Person <bperson@example.com>
+ on test@example.com as MemberRole.member>
+
+ >>> subscribe(mlist, 'Cris')
+ <Member: Cris Person <cperson@example.com>
+ on test@example.com as MemberRole.member>
Normally, messages would show up in the outgoing queue after the message has
been processed by the rule set and pipeline. But we can simulate that here by
diff --git a/src/mailman/testing/config-with-instances.pck b/src/mailman/testing/config-with-instances.pck
new file mode 100644
index 000000000..b5173f58f
--- /dev/null
+++ b/src/mailman/testing/config-with-instances.pck
Binary files differ
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 476211a08..8fa4fbd2f 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -33,7 +33,6 @@ __all__ = [
'reset_the_world',
'specialized_message_from_string',
'subscribe',
- 'subscribe_ex',
'temporary_db',
'wait_for_webservice',
]
@@ -437,7 +436,10 @@ class chdir:
def subscribe(mlist, first_name, role=MemberRole.member, email=None):
- """Helper for subscribing a sample person to a mailing list."""
+ """Helper for subscribing a sample person to a mailing list.
+
+ Returns the newly created member object.
+ """
user_manager = getUtility(IUserManager)
email = ('{0}person@example.com'.format(first_name[0].lower())
if email is None else email)
@@ -453,25 +455,9 @@ def subscribe(mlist, first_name, role=MemberRole.member, email=None):
subscription_address = address
else:
subscription_address = list(person.addresses)[0]
- # We can't return the newly created member because that will
- # implicitly open a new transaction, which can break doctests. If you
- # really need the newly created member, look it up.
mlist.subscribe(subscription_address, role)
-
-
-def subscribe_ex(mlist, first_name, role=MemberRole.member, email=None):
- """Like ``subscribe()`` but returns the newly created member object.
-
- Only use this in contexts where you can accept the opening of an implicit
- transaction (i.e. *not* in REST tests) unless you explicitly close said
- transaction. Otherwise you will lock the database.
- """
- # Blarg. I wish we didn't have to duplicate this logic.
- email = ('{0}person@example.com'.format(first_name[0].lower())
- if email is None else email)
- subscribe(mlist, first_name, role, email)
- roster = mlist.get_roster(role)
- return roster.get_member(email)
+ roster = mlist.get_roster(role)
+ return roster.get_member(email)