summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/interfaces/mailinglist.py18
-rw-r--r--src/mailman/model/mailinglist.py5
-rw-r--r--src/mailman/rest/docs/configuration.txt116
-rw-r--r--src/mailman/rest/lists.py8
4 files changed, 97 insertions, 50 deletions
diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py
index bede58b6c..fba5d71ef 100644
--- a/src/mailman/interfaces/mailinglist.py
+++ b/src/mailman/interfaces/mailinglist.py
@@ -294,6 +294,24 @@ class IMailingList(Interface):
'location' attribute.
"""
+ # Notifications.
+
+ admin_immed_notify = Attribute(
+ """Flag controlling immediate notification of requests.
+
+ List moderators normally get daily notices about pending
+ administrative requests. This flag controls whether moderators also
+ receive immediate notification of such pending requests.
+ """)
+
+ admin_notify_mchanges = Attribute(
+ """Flag controlling notification of joins and leaves.
+
+ List moderators can receive notifications for every member that joins
+ or leaves their mailing lists. This flag controls those
+ notifications.
+ """)
+
# Processing.
pipeline = Attribute(
diff --git a/src/mailman/model/mailinglist.py b/src/mailman/model/mailinglist.py
index f3c76dc25..566e24341 100644
--- a/src/mailman/model/mailinglist.py
+++ b/src/mailman/model/mailinglist.py
@@ -61,6 +61,9 @@ class MailingList(Model):
id = Int(primary=True)
+ # XXX denotes attributes that should be part of the public interface but
+ # are currently missing.
+
# List identity
list_name = Unicode()
host_name = Unicode()
@@ -84,7 +87,7 @@ class MailingList(Model):
# Attributes which are directly modifiable via the web u/i. The more
# complicated attributes are currently stored as pickles, though that
# will change as the schema and implementation is developed.
- accept_these_nonmembers = Pickle()
+ accept_these_nonmembers = Pickle() # XXX
admin_immed_notify = Bool()
admin_notify_mchanges = Bool()
administrivia = Bool()
diff --git a/src/mailman/rest/docs/configuration.txt b/src/mailman/rest/docs/configuration.txt
index 506e263a2..dfe2c023e 100644
--- a/src/mailman/rest/docs/configuration.txt
+++ b/src/mailman/rest/docs/configuration.txt
@@ -15,6 +15,8 @@ All readable attributes for a list are available on a sub-resource.
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config')
+ admin_immed_notify: True
+ admin_notify_mchanges: False
bounces_address: test-one-bounces@example.com
collapse_alternatives: True
convert_html_to_plaintext: False
@@ -54,15 +56,18 @@ writable attributes in one request.
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config',
- ... dict(real_name='Fnords',
- ... include_rfc2369_headers=False,
- ... include_list_post_header=False,
- ... digest_size_threshold=10.5,
- ... pipeline='virgin',
- ... filter_content=True,
- ... convert_html_to_plaintext=True,
- ... collapse_alternatives=False,
- ... ),
+ ... dict(
+ ... admin_immed_notify=False,
+ ... admin_notify_mchanges=True,
+ ... real_name='Fnords',
+ ... include_rfc2369_headers=False,
+ ... include_list_post_header=False,
+ ... digest_size_threshold=10.5,
+ ... pipeline='virgin',
+ ... filter_content=True,
+ ... convert_html_to_plaintext=True,
+ ... collapse_alternatives=False,
+ ... ),
... 'PUT')
content-length: 0
date: ...
@@ -73,7 +78,9 @@ These values are changed permanently.
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config')
- bounces_address: test-one-bounces@example.com
+ admin_immed_notify: False
+ admin_notify_mchanges: True
+ ...
collapse_alternatives: False
convert_html_to_plaintext: True
...
@@ -93,14 +100,18 @@ be included. It is an error to leave one out (e.g. `pipeline`)...
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config',
- ... dict(real_name='Fnords',
- ... include_rfc2369_headers=False,
- ... include_list_post_header=False,
- ... digest_size_threshold=10.5,
- ... filter_content=True,
- ... convert_html_to_plaintext=True,
- ... collapse_alternatives=False,
- ... ),
+ ... dict(
+ ... #admin_immed_notify=False,
+ ... admin_notify_mchanges=True,
+ ... real_name='Fnords',
+ ... include_rfc2369_headers=False,
+ ... include_list_post_header=False,
+ ... digest_size_threshold=10.5,
+ ... pipeline='virgin',
+ ... filter_content=True,
+ ... convert_html_to_plaintext=True,
+ ... collapse_alternatives=False,
+ ... ),
... 'PUT')
Traceback (most recent call last):
...
@@ -110,16 +121,19 @@ be included. It is an error to leave one out (e.g. `pipeline`)...
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config',
- ... dict(real_name='Fnords',
- ... include_rfc2369_headers=False,
- ... include_list_post_header=False,
- ... digest_size_threshold=10.5,
- ... pipeline='virgin',
- ... filter_content=True,
- ... convert_html_to_plaintext=True,
- ... collapse_alternatives=False,
- ... whats_this=True,
- ... ),
+ ... dict(
+ ... a_mailing_list_attribute=False,
+ ... admin_immed_notify=False,
+ ... admin_notify_mchanges=True,
+ ... real_name='Fnords',
+ ... include_rfc2369_headers=False,
+ ... include_list_post_header=False,
+ ... digest_size_threshold=10.5,
+ ... pipeline='virgin',
+ ... filter_content=True,
+ ... convert_html_to_plaintext=True,
+ ... collapse_alternatives=False,
+ ... ),
... 'PUT')
Traceback (most recent call last):
...
@@ -129,15 +143,18 @@ It is also an error to spell an attribute value incorrectly...
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config',
- ... dict(real_name='Fnords',
- ... include_rfc2369_headers=False,
- ... include_list_post_header=False,
- ... digest_size_threshold=10.5,
- ... pipeline='virgin',
- ... filter_content=True,
- ... convert_html_to_plaintext=True,
- ... collapse_alternatives='Nope',
- ... ),
+ ... dict(
+ ... admin_immed_notify='Nope',
+ ... admin_notify_mchanges=True,
+ ... real_name='Fnords',
+ ... include_rfc2369_headers=False,
+ ... include_list_post_header=False,
+ ... digest_size_threshold=10.5,
+ ... pipeline='virgin',
+ ... filter_content=True,
+ ... convert_html_to_plaintext=True,
+ ... collapse_alternatives=False,
+ ... ),
... 'PUT')
Traceback (most recent call last):
...
@@ -147,15 +164,18 @@ It is also an error to spell an attribute value incorrectly...
>>> dump_json('http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config',
- ... dict(real_name='Fnords',
- ... include_rfc2369_headers=False,
- ... include_list_post_header=False,
- ... digest_size_threshold=10.5,
- ... pipeline='dummy',
- ... filter_content=True,
- ... convert_html_to_plaintext=True,
- ... collapse_alternatives=False,
- ... ),
+ ... dict(
+ ... admin_immed_notify=False,
+ ... admin_notify_mchanges=True,
+ ... real_name='Fnords',
+ ... include_rfc2369_headers=False,
+ ... include_list_post_header=False,
+ ... digest_size_threshold=10.5,
+ ... pipeline='dummy',
+ ... filter_content=True,
+ ... convert_html_to_plaintext=True,
+ ... collapse_alternatives=False,
+ ... ),
... 'PUT')
Traceback (most recent call last):
...
@@ -215,12 +235,12 @@ dictionary are ignored.
server: WSGIServer/...
status: 200
-The order of aliases is not guaranteed.
+Aliases are returned as a list on the 'aliases' key.
>>> response = call_http(
... 'http://localhost:8001/3.0/lists/'
... 'test-one@example.com/config/acceptable_aliases')
- >>> for alias in sorted(response['aliases']):
+ >>> for alias in response['aliases']:
... print alias
bar@example.net
foo@example.com
diff --git a/src/mailman/rest/lists.py b/src/mailman/rest/lists.py
index 5b76abbf0..896198748 100644
--- a/src/mailman/rest/lists.py
+++ b/src/mailman/rest/lists.py
@@ -242,6 +242,9 @@ READABLE = (
# Web access.
'scheme',
'web_host',
+ # Notifications.
+ 'admin_immed_notify',
+ 'admin_notify_mchanges',
# Processing.
'pipeline',
'filter_content',
@@ -264,6 +267,9 @@ VALIDATORS = {
'include_rfc2369_headers': as_boolean,
# Digests.
'digest_size_threshold': float,
+ # Notifications.
+ 'admin_immed_notify': as_boolean,
+ 'admin_notify_mchanges': as_boolean,
# Processing.
'pipeline': pipeline_validator,
'filter_content': as_boolean,
@@ -323,7 +329,7 @@ class AcceptableAliases(resource.Resource):
def aliases(self, request):
"""Return the mailing list's acceptable aliases."""
aliases = IAcceptableAliasSet(self._mlist)
- resource = dict(aliases=list(aliases.aliases))
+ resource = dict(aliases=sorted(aliases.aliases))
return http.ok([], etag(resource))
@resource.PUT()