summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2011-08-14 18:50:19 -0400
committerBarry Warsaw2011-08-14 18:50:19 -0400
commit061643ac76b4fba0b95b9e6260df44c69412ec07 (patch)
treefbe9946566879c6ea8b02355443346d37720c83e
parentc93ef05f6f4bda7826f51ea2f2a820581683b476 (diff)
downloadmailman-061643ac76b4fba0b95b9e6260df44c69412ec07.tar.gz
mailman-061643ac76b4fba0b95b9e6260df44c69412ec07.tar.zst
mailman-061643ac76b4fba0b95b9e6260df44c69412ec07.zip
Remove role plurals from /lists/<fqdn_listname/rosters/<role>
-rw-r--r--src/mailman/docs/NEWS.rst1
-rw-r--r--src/mailman/rest/docs/membership.rst19
-rw-r--r--src/mailman/rest/lists.py10
3 files changed, 20 insertions, 10 deletions
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 3528400b9..4cb9a3bca 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -30,6 +30,7 @@ REST
required), `fqdn_listname` (optional), and `role` (i.e. MemberRole -
optional). (LP: #799612)
* Fixed /lists/<fqdn_listname>/<role>/<email> (LP: #825570)
+ * Remove role plurals from /lists/<fqdn_listname/rosters/<role>
Commands
--------
diff --git a/src/mailman/rest/docs/membership.rst b/src/mailman/rest/docs/membership.rst
index 6932459dc..426b80acf 100644
--- a/src/mailman/rest/docs/membership.rst
+++ b/src/mailman/rest/docs/membership.rst
@@ -169,7 +169,7 @@ User ids are different than member ids.
We can also get just the members of a single mailing list.
>>> dump_json(
- ... 'http://localhost:9001/3.0/lists/ant@example.com/roster/members')
+ ... 'http://localhost:9001/3.0/lists/ant@example.com/roster/member')
entry 0:
address: aperson@example.com
fqdn_listname: ant@example.com
@@ -254,6 +254,21 @@ mailing list.
start: 0
total_size: 7
+We can access all the owners of a list.
+
+ >>> dump_json(
+ ... 'http://localhost:9001/3.0/lists/bee@example.com/roster/owner')
+ entry 0:
+ address: cperson@example.com
+ fqdn_listname: bee@example.com
+ http_etag: ...
+ role: owner
+ self_link: http://localhost:9001/3.0/members/7
+ user: http://localhost:9001/3.0/users/2
+ http_etag: ...
+ start: 0
+ total_size: 1
+
Finding members
===============
@@ -298,7 +313,7 @@ list.
>>> dump_json('http://localhost:9001/3.0/members/find', {
... 'subscriber': 'cperson@example.com',
- ... 'fqdn_listname': 'bee@example.com',
+ ... 'fqdn_listname': 'bee@example.com',
... })
entry 0:
address: cperson@example.com
diff --git a/src/mailman/rest/lists.py b/src/mailman/rest/lists.py
index a8b4fac4f..2c2f58da1 100644
--- a/src/mailman/rest/lists.py
+++ b/src/mailman/rest/lists.py
@@ -68,18 +68,12 @@ def member_matcher(request, segments):
def roster_matcher(request, segments):
"""A matcher of all members URLs inside mailing lists.
- e.g. /roster/members
- /roster/owners
- /roster/moderators
-
- The URL roles are the plural form of the MemberRole enum, because the
- former reads better.
+ e.g. /roster/<role>
"""
if len(segments) != 2 or segments[0] != 'roster':
return None
- role = segments[1][:-1]
try:
- return (), dict(role=MemberRole[role]), ()
+ return (), dict(role=MemberRole[segments[1]]), ()
except ValueError:
# Not a valid role.
return None