[02/17] REST: Show 'web_url' in embedded series responses

Message ID 20181030111916.7342-3-stephen@that.guru
State New
Headers show
Series
  • Add OpenAPI 3.0.0 REST API spec
Related show

Commit Message

Stephen Finucane Oct. 30, 2018, 11:19 a.m.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #224
Fixes: 9c179bf4c ("REST: Add 'web_url' link to API responses")
---
 patchwork/api/embedded.py                          | 3 ++-
 releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml

Comments

Daniel Axtens Nov. 8, 2018, 1:18 p.m. | #1
LGTM, but I still haven't spent enough time around DRF to feel confident
saying more than that.

Patch 3 has disappeared from my mail client (this is an annoyingly
common occurence and I have no idea why it occurs.) It also looks good
to me.

Regards,
Daniel


Stephen Finucane <stephen@that.guru> writes:

> Signed-off-by: Stephen Finucane <stephen@that.guru>
> Closes: #224
> Fixes: 9c179bf4c ("REST: Add 'web_url' link to API responses")
> ---
>  patchwork/api/embedded.py                          | 3 ++-
>  releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml | 5 +++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>  create mode 100644 releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml
>
> diff --git a/patchwork/api/embedded.py b/patchwork/api/embedded.py
> index 83df0e50..72ffc68a 100644
> --- a/patchwork/api/embedded.py
> +++ b/patchwork/api/embedded.py
> @@ -187,7 +187,8 @@ class SeriesSerializer(SerializedRelatedField):
>  
>          class Meta:
>              model = models.Series
> -            fields = ('id', 'url', 'date', 'name', 'version', 'mbox')
> +            fields = ('id', 'url', 'web_url', 'date', 'name', 'version',
> +                      'mbox')
>              read_only_fields = fields
>              versioned_field = {
>                  '1.1': ('web_url', ),
> diff --git a/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml b/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml
> new file mode 100644
> index 00000000..f6e9ccaa
> --- /dev/null
> +++ b/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml
> @@ -0,0 +1,5 @@
> +---
> +fixes:
> +  - |
> +    API resources with embedded series were not showing the ``web_url`` value
> +    for these series. This is now shown.
> -- 
> 2.17.2
>
> _______________________________________________
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork

Patch

diff --git a/patchwork/api/embedded.py b/patchwork/api/embedded.py
index 83df0e50..72ffc68a 100644
--- a/patchwork/api/embedded.py
+++ b/patchwork/api/embedded.py
@@ -187,7 +187,8 @@  class SeriesSerializer(SerializedRelatedField):
 
         class Meta:
             model = models.Series
-            fields = ('id', 'url', 'date', 'name', 'version', 'mbox')
+            fields = ('id', 'url', 'web_url', 'date', 'name', 'version',
+                      'mbox')
             read_only_fields = fields
             versioned_field = {
                 '1.1': ('web_url', ),
diff --git a/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml b/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml
new file mode 100644
index 00000000..f6e9ccaa
--- /dev/null
+++ b/releasenotes/notes/issue-224-8f1c4207aa273ac6.yaml
@@ -0,0 +1,5 @@ 
+---
+fixes:
+  - |
+    API resources with embedded series were not showing the ``web_url`` value
+    for these series. This is now shown.