diff options
| author | Barry Warsaw | 2007-08-05 08:42:16 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-08-05 08:42:16 -0400 |
| commit | e0abca9fbdde530f7517396677c87f19c86bc0c6 (patch) | |
| tree | 129da7df5fad55cb4be4d61b2f5815c0c68d1f33 /Mailman/app/create.py | |
| parent | 2999c404a486cb0c7bd76407501e0a6b775c148a (diff) | |
| download | mailman-e0abca9fbdde530f7517396677c87f19c86bc0c6.tar.gz mailman-e0abca9fbdde530f7517396677c87f19c86bc0c6.tar.zst mailman-e0abca9fbdde530f7517396677c87f19c86bc0c6.zip | |
Diffstat (limited to 'Mailman/app/create.py')
| -rw-r--r-- | Mailman/app/create.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Mailman/app/create.py b/Mailman/app/create.py index 4e94a3e44..d2f85d90d 100644 --- a/Mailman/app/create.py +++ b/Mailman/app/create.py @@ -23,11 +23,14 @@ from Mailman.Utils import ValidateEmail from Mailman.app.plugins import get_plugin from Mailman.app.styles import style_manager from Mailman.configuration import config +from Mailman.constants import MemberRole -def create_list(fqdn_listname): +def create_list(fqdn_listname, owners=None): """Create the named list and apply styles.""" + if owners is None: + owners = [] ValidateEmail(fqdn_listname) listname, domain = Utils.split_listname(fqdn_listname) if domain not in config.domains: @@ -43,4 +46,15 @@ def create_list(fqdn_listname): # XXX FIXME ## mta_plugin = get_plugin('mailman.mta') ## mta_plugin().create(mlist) + # Create any owners that don't yet exist, and subscribe all addresses as + # owners of the mailing list. + usermgr = config.db.user_manager + for owner_address in owners: + addr = usermgr.get_address(owner_address) + if addr is None: + # XXX Make this use an IRegistrar instead, but that requires + # sussing out the IDomain stuff. For now, fake it. + user = usermgr.create_user(owner_address) + addr = list(user.addresses)[0] + addr.subscribe(mlist, MemberRole.owner) return mlist |
