diff mbox

[02/10] models: Add 'Series' model and related models

Message ID e0f1f791-ebb1-4e4c-a7f3-a40fa52e5949@au1.ibm.com
State Superseded
Headers show

Commit Message

Andrew Donnellan July 19, 2016, 2:56 a.m. UTC
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 <stephen.finucane@intel.com>
>> ---
>
> 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 <andrew.donnellan@au1.ibm.com>

      state = SerializerMethodField()
diff mbox

Patch

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()