diff options
| author | Aurélien Bompard | 2015-11-06 01:05:42 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2015-11-15 15:10:42 -0500 |
| commit | 9975ac00206e70da7d7c9bebf9d22192bafb88ac (patch) | |
| tree | 4049ac9dce25d95db13d98863f05a4f2c818cb5e /src | |
| parent | 29947f0ef5667490f704b558c2acea653cabdca9 (diff) | |
| download | mailman-9975ac00206e70da7d7c9bebf9d22192bafb88ac.tar.gz mailman-9975ac00206e70da7d7c9bebf9d22192bafb88ac.tar.zst mailman-9975ac00206e70da7d7c9bebf9d22192bafb88ac.zip | |
Diffstat (limited to 'src')
| -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) |
