Commit 9975ac00 authored by Aurélien Bompard's avatar Aurélien Bompard Committed by Barry Warsaw

REST: add a self_link entry to held messages

parent 29947f0e
...@@ -52,6 +52,7 @@ When a message gets held for moderator approval, it shows up in this list. ...@@ -52,6 +52,7 @@ When a message gets held for moderator approval, it shows up in this list.
<BLANKLINE> <BLANKLINE>
reason: Because reason: Because
request_id: 1 request_id: 1
self_link: http://localhost:9001/3.0/lists/ant.example.com/held/1
sender: [email protected] sender: [email protected]
subject: Something subject: Something
http_etag: "..." http_etag: "..."
......
...@@ -137,7 +137,11 @@ class HeldMessages(_HeldMessageBase, CollectionMixin): ...@@ -137,7 +137,11 @@ class HeldMessages(_HeldMessageBase, CollectionMixin):
def _resource_as_dict(self, request): def _resource_as_dict(self, request):
"""See `CollectionMixin`.""" """See `CollectionMixin`."""
return self._make_resource(request.id) resource = self._make_resource(request.id)
if resource is not None:
resource['self_link'] = self.path_to('lists/{0}/held/{1}'.format(
self._mlist.list_id, resource['request_id']))
return resource
def _get_collection(self, request): def _get_collection(self, request):
requests = IListRequests(self._mlist) requests = IListRequests(self._mlist)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment