diff options
| author | Barry Warsaw | 2015-03-26 16:47:09 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-03-26 16:47:09 -0400 |
| commit | 72630c5b467e14cce6f4d6480ae8640c69f92a3e (patch) | |
| tree | d1d95e77bf106158e40a11de006680ce88cbe215 /src/mailman/commands/cli_members.py | |
| parent | b2c2507402f0578e86bc37bac0711979270e8821 (diff) | |
| parent | e16cd87fcbef9f7f1451378150404440dbdee0e8 (diff) | |
| download | mailman-72630c5b467e14cce6f4d6480ae8640c69f92a3e.tar.gz mailman-72630c5b467e14cce6f4d6480ae8640c69f92a3e.tar.zst mailman-72630c5b467e14cce6f4d6480ae8640c69f92a3e.zip | |
Merging in several refactorings, and a REST API change.
Backward Incompatible REST API Changes:
* The JSON representation for subscription holds now no longer contains the
`password` key. Also, the `address` key has been renamed to `email` for
consistency with established terminology and other usage.
Other Internal API Changes:
* IUserManager has grown a `make_user()` method.
Refactorings:
* Most uses in the test suite of add_member() have been replaced with a new
version of the subscribe() helper. This reduces the surface area of this
ancient internal API. Eventually add_member() will have to go away or
significantly change with the subscription policy workflow.
* hold_subscription() as well as the remaining instances of add_member() now
use a namedtuple in their arguments, to keep the signatures manageable.
Diffstat (limited to 'src/mailman/commands/cli_members.py')
| -rw-r--r-- | src/mailman/commands/cli_members.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailman/commands/cli_members.py b/src/mailman/commands/cli_members.py index e4cad5966..ccacbeeb8 100644 --- a/src/mailman/commands/cli_members.py +++ b/src/mailman/commands/cli_members.py @@ -27,15 +27,14 @@ import codecs from email.utils import formataddr, parseaddr from mailman.app.membership import add_member -from mailman.config import config from mailman.core.i18n import _ from mailman.database.transaction import transactional from mailman.interfaces.command import ICLISubCommand from mailman.interfaces.listmanager import IListManager from mailman.interfaces.member import ( AlreadySubscribedError, DeliveryMode, DeliveryStatus) +from mailman.interfaces.subscriptions import RequestRecord from operator import attrgetter -from passlib.utils import generate_password as generate from zope.component import getUtility from zope.interface import implementer @@ -193,12 +192,11 @@ class Members: continue # Parse the line and ensure that the values are unicodes. display_name, email = parseaddr(line) - # Give the user a default, user-friendly password. - password = generate(int(config.passwords.password_length)) try: - add_member(mlist, email, display_name, password, - DeliveryMode.regular, - mlist.preferred_language.code) + add_member(mlist, + RequestRecord(email, display_name, + DeliveryMode.regular, + mlist.preferred_language.code)) except AlreadySubscribedError: # It's okay if the address is already subscribed, just # print a warning and continue. |
