On 19/07/16 10:50, Russell Currey wrote:
On Mon, 2016-06-13 at 11:41 +0100, Stephen Finucane wrote:
Add a series model. This model is intentionally very minimal to allow
as much dynaminism as possible. It is expected that patches will be
migrated between series as new data is provided.

Signed-off-by: Stephen Finucane <[email protected]>
---

I'm pretty sure this broke the patches API, though I'm not exactly a Django
expert.  Here's what I'm seeing:

Exception Type: ImproperlyConfigured at /api/1.0/patches/
Exception Value: Could not resolve URL for hyperlinked relationship using view
name "seriesrevision-detail". You may have failed to include the related model
in your API, or incorrectly configured the `lookup_field` attribute on this
field.

Full log here: http://dpaste.com/0P3C63K

Temporary fix to exclude the series field from the Patch endpoint.

Signed-off-by: Andrew Donnellan <[email protected]>

diff --git a/patchwork/rest_serializers.py b/patchwork/rest_serializers.py
index af6b1b7..be55ad1 100644
--- a/patchwork/rest_serializers.py
+++ b/patchwork/rest_serializers.py
@@ -84,7 +84,7 @@ class PatchSerializer(URLSerializer):
                             'content', 'hash', 'msgid')
# there's no need to expose an entire "tags" endpoint, so we custom
         # render this field
-        exclude = ('tags',)
+        exclude = ('tags', 'series')
     check_names = dict(Check.STATE_CHOICES)
     mbox_url = SerializerMethodField()
     state = SerializerMethodField()


--
Andrew Donnellan              OzLabs, ADL Canberra
[email protected]  IBM Australia Limited

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to