[PATCH 4/6] REST: Add 'mbox' to cover-letter response
Stephen Finucane
stephen at that.guru
Wed Jan 10 11:05:24 AEDT 2018
This should have been here in the first place. Not sure why it was
missed.
Signed-off-by: Stephen Finucane <stephen at that.guru>
---
NOTE: We need to add API versioning before we can release this. That can
come later.
---
patchwork/api/embedded.py | 4 ++--
releasenotes/notes/cover-letter-mbox-a873f2204a850425.yaml | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
create mode 100644 releasenotes/notes/cover-letter-mbox-a873f2204a850425.yaml
diff --git a/patchwork/api/embedded.py b/patchwork/api/embedded.py
index 122422a4..7b5090a0 100644
--- a/patchwork/api/embedded.py
+++ b/patchwork/api/embedded.py
@@ -75,11 +75,11 @@ class CheckSerializer(HyperlinkedModelSerializer):
}
-class CoverLetterSerializer(HyperlinkedModelSerializer):
+class CoverLetterSerializer(MboxMixin, HyperlinkedModelSerializer):
class Meta:
model = models.CoverLetter
- fields = ('id', 'url', 'msgid', 'date', 'name')
+ fields = ('id', 'url', 'msgid', 'date', 'name', 'mbox')
read_only_fields = fields
extra_kwargs = {
'url': {'view_name': 'api-cover-detail'},
diff --git a/releasenotes/notes/cover-letter-mbox-a873f2204a850425.yaml b/releasenotes/notes/cover-letter-mbox-a873f2204a850425.yaml
new file mode 100644
index 00000000..d79e6078
--- /dev/null
+++ b/releasenotes/notes/cover-letter-mbox-a873f2204a850425.yaml
@@ -0,0 +1,6 @@
+---
+api:
+ - |
+ Cover letters embedded in other responses now provide an mbox link, which
+ can be used to download the cover letter and associated metadata (tags) in
+ mbox format.
--
2.14.3
More information about the Patchwork
mailing list