diff options
| author | Barry Warsaw | 2012-12-30 14:39:10 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-12-30 14:39:10 -0500 |
| commit | a0244a524117c90cbf22f0007b96933c4fb2aa4b (patch) | |
| tree | 21fc100ba690971aa1310fb08c82fedc5f38084c /src/mailman/app/lifecycle.py | |
| parent | 2450a9c9642d06af1a60df70acb742e67959d77e (diff) | |
| parent | 5ec8a131c602f9b00d6b25d914ffc923cd1aa964 (diff) | |
| download | mailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.tar.gz mailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.tar.zst mailman-a0244a524117c90cbf22f0007b96933c4fb2aa4b.zip | |
* List styles are supported through the REST API. Get the list of available
styles (by name) via `.../lists/styles`. Create a list in a specific style
by using POST data `style_name=<style>`. (LP: #975692)
* The default list style is renamed to `legacy-default` and a new
`legacy-announce` style is added. This is similar to the `legacy-default`
except set up for announce-only lists.
* The following columns were unused and have been removed:
- `mailinglist.new_member_options`
- `mailinglist.send_reminders`
- `mailinglist.subscribe_policy`
- `mailinglist.unsubscribe_policy`
- `mailinglist.subscribe_auto_approval`
- `mailinglist.private_roster`
- `mailinglist.admin_member_chunksize`
Also:
* List styles no longer have a priority, nor is there any style matching any
more. Now, exactly one named style (either explicitly through the
`create_list()` function, or by default from the configuration file) is
applied to a list at list creation time.
* The huge old DefaultStyle is now decomposed into smaller units. An
announce-like style is added.
* `find_components()` and `scan_module()` moved from `app/finder.py` to
`utilities/modules.py`.
* Lots of doctest rewriting for better documentation. Bad-path tests moved
to unittests.
* `create_list()` now takes an optional `style_name` parameter. If not
given, `[styles]default` is used.
* `create_list()` doesn't set the `personalize` or `display_name` attributes
any more. These are already set in styles.
* Removed an unnecessary `tearDown()`.
* Added some improvements on displaying lists in JSON responses.
Diffstat (limited to 'src/mailman/app/lifecycle.py')
| -rw-r--r-- | src/mailman/app/lifecycle.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mailman/app/lifecycle.py b/src/mailman/app/lifecycle.py index 326498478..9dfa5a9a2 100644 --- a/src/mailman/app/lifecycle.py +++ b/src/mailman/app/lifecycle.py @@ -47,7 +47,7 @@ log = logging.getLogger('mailman.error') -def create_list(fqdn_listname, owners=None): +def create_list(fqdn_listname, owners=None, style_name=None): """Create the named list and apply styles. The mailing may not exist yet, but the domain specified in `fqdn_listname` @@ -57,6 +57,9 @@ def create_list(fqdn_listname, owners=None): :type fqdn_listname: string :param owners: The mailing list owners. :type owners: list of string email addresses + :param style_name: The name of the style to apply to the newly created + list. If not given, the default is taken from the configuration file. + :type style_name: string :return: The new mailing list. :rtype: `IMailingList` :raises BadDomainSpecificationError: when the hostname part of @@ -66,13 +69,16 @@ def create_list(fqdn_listname, owners=None): """ if owners is None: owners = [] - # This raises I + # This raises InvalidEmailAddressError if the address is not a valid + # posting address. Let these percolate up. getUtility(IEmailValidator).validate(fqdn_listname) listname, domain = fqdn_listname.split('@', 1) if domain not in getUtility(IDomainManager): raise BadDomainSpecificationError(domain) mlist = getUtility(IListManager).create(fqdn_listname) - for style in getUtility(IStyleManager).lookup(mlist): + style = getUtility(IStyleManager).get( + config.styles.default if style_name is None else style_name) + if style is not None: style.apply(mlist) # Coordinate with the MTA, as defined in the configuration file. call_name(config.mta.incoming).create(mlist) |
