diff options
| -rw-r--r-- | src/mailman/rest/docs/post-moderation.rst | 1 | ||||
| -rw-r--r-- | src/mailman/rest/post_moderation.py | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mailman/rest/docs/post-moderation.rst b/src/mailman/rest/docs/post-moderation.rst index 671f36e73..c6720339c 100644 --- a/src/mailman/rest/docs/post-moderation.rst +++ b/src/mailman/rest/docs/post-moderation.rst @@ -52,6 +52,7 @@ When a message gets held for moderator approval, it shows up in this list. <BLANKLINE> reason: Because request_id: 1 + self_link: http://localhost:9001/3.0/lists/ant.example.com/held/1 sender: anne@example.com subject: Something http_etag: "..." diff --git a/src/mailman/rest/post_moderation.py b/src/mailman/rest/post_moderation.py index 75520904c..77d81fa15 100644 --- a/src/mailman/rest/post_moderation.py +++ b/src/mailman/rest/post_moderation.py @@ -137,7 +137,11 @@ class HeldMessages(_HeldMessageBase, CollectionMixin): def _resource_as_dict(self, request): """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): requests = IListRequests(self._mlist) |
