Barry Warsaw pushed to branch master at mailman / Mailman
Commits:
6a83017b by Aurélien Bompard at 2016-08-30T15:11:53+02:00
REST: allow MailingList.info to be set
- - - - -
c23519b5 by Aurélien Bompard at 2016-08-31T18:31:52+02:00
Use a multiline value and update NEWS
- - - - -
4 changed files:
- src/mailman/docs/NEWS.rst
- src/mailman/rest/docs/listconf.rst
- src/mailman/rest/listconf.py
- src/mailman/rest/tests/test_listconf.py
Changes:
=====================================
src/mailman/docs/NEWS.rst
=====================================
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -88,6 +88,8 @@ Bugs
* Email address validation is now more compliant with RFC 5321. (Closes #266)
* A mailing list's ``description`` must not contain newlines. Given by
Aurélien Bompard. (Closes: #273)
+ * Allow MailingList.info to be set using the REST API. Given by Aurélien
+ Bompard.
Configuration
-------------
=====================================
src/mailman/rest/docs/listconf.rst
=====================================
--- a/src/mailman/rest/docs/listconf.rst
+++ b/src/mailman/rest/docs/listconf.rst
@@ -52,6 +52,7 @@ All readable attributes for a list are available on a
sub-resource.
header_uri:
http_etag: "..."
include_rfc2369_headers: True
+ info:
join_address: [email protected]
last_post_at: None
leave_address: [email protected]
@@ -103,6 +104,7 @@ When using ``PUT``, all writable attributes must be
included.
... display_name='Fnords',
... description='This is my mailing list',
... include_rfc2369_headers=False,
+ ... info='This is the mailing list information',
... allow_list_posts=False,
... digest_send_periodic=False,
... digest_size_threshold=10.5,
=====================================
src/mailman/rest/listconf.py
=====================================
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -155,6 +155,7 @@ ATTRIBUTES = dict(
mail_host=GetterSetter(None),
allow_list_posts=GetterSetter(as_boolean),
include_rfc2369_headers=GetterSetter(as_boolean),
+ info=GetterSetter(str),
join_address=GetterSetter(None),
last_post_at=GetterSetter(None),
leave_address=GetterSetter(None),
=====================================
src/mailman/rest/tests/test_listconf.py
=====================================
--- a/src/mailman/rest/tests/test_listconf.py
+++ b/src/mailman/rest/tests/test_listconf.py
@@ -66,6 +66,7 @@ RESOURCE = dict(
first_strip_reply_to=True,
goodbye_message_uri='mailman:///goodbye.txt',
include_rfc2369_headers=False,
+ info='This is the mailing list info',
moderator_password='password',
posting_pipeline='virgin',
reply_goes_to_list='point_to_list',
@@ -449,3 +450,18 @@ class TestConfiguration(unittest.TestCase):
self.assertEqual(cm.exception.code, 400)
self.assertEqual(cm.exception.reason,
b'Cannot convert parameters: description')
+
+ def test_patch_info(self):
+ with transaction():
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config',
+ dict(info='multiline\ntest\nvalue'),
+ 'PATCH')
+ self.assertEqual(self._mlist.info, 'multiline\ntest\nvalue')
+ # Now empty it
+ with transaction():
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config',
+ dict(info=''),
+ 'PATCH')
+ self.assertEqual(self._mlist.info, '')
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/1c10a3ffa238082ffa3dac41c5edd2cde3984b6f...c23519b5262fd264ed0f9e5bc23b901ed7eee632
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org