summaryrefslogtreecommitdiff
path: root/src/mailman/rest/lists.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-07-04 14:58:45 -0400
committerBarry Warsaw2015-07-18 23:21:05 -0400
commit759efff6eb63b3ba1fff15193923a3df72eb552c (patch)
tree97d61b867217476be4ef58de389644ee88d0ed13 /src/mailman/rest/lists.py
parentfddfcbde937f61657bb29253609b63670beaae46 (diff)
downloadmailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.gz
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.zst
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.zip
Diffstat (limited to 'src/mailman/rest/lists.py')
-rw-r--r--src/mailman/rest/lists.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mailman/rest/lists.py b/src/mailman/rest/lists.py
index 0607102cb..3409a3a00 100644
--- a/src/mailman/rest/lists.py
+++ b/src/mailman/rest/lists.py
@@ -40,7 +40,7 @@ from mailman.interfaces.subscriptions import ISubscriptionService
from mailman.rest.listconf import ListConfiguration
from mailman.rest.helpers import (
CollectionMixin, GetterSetter, NotFound, bad_request, child, created,
- etag, no_content, not_found, okay, paginate, path_to)
+ etag, no_content, not_found, okay, paginate)
from mailman.rest.members import AMember, MemberCollection
from mailman.rest.post_moderation import HeldMessages
from mailman.rest.sub_moderation import SubscriptionRequests
@@ -109,7 +109,7 @@ class _ListBase(CollectionMixin):
mail_host=mlist.mail_host,
member_count=mlist.members.member_count,
volume=mlist.volume,
- self_link=path_to('lists/{0}'.format(mlist.list_id)),
+ self_link=self.path_to('lists/{0}'.format(mlist.list_id)),
)
@paginate
@@ -213,7 +213,8 @@ class AllLists(_ListBase):
except ValueError as error:
bad_request(response, str(error))
else:
- created(response, path_to('lists/{0}'.format(mlist.list_id)))
+ location = self.path_to('lists/{0}'.format(mlist.list_id))
+ created(response, location)
def on_get(self, request, response):
"""/lists"""
@@ -234,7 +235,8 @@ class MembersOfList(MemberCollection):
def _get_collection(self, request):
"""See `CollectionMixin`."""
# Overrides _MemberBase._get_collection() because we only want to
- # return the members from the requested roster.
+ # return the members from the requested roster. Don't call super()
+ # but be sure to set the request object.
roster = self._mlist.get_roster(self._role)
address_of_member = attrgetter('address.email')
return list(sorted(roster.members, key=address_of_member))