mirror of
https://github.com/pinry/pinry.git
synced 2025-11-14 00:55:43 +01:00
Fix tags being serialized as stringified map objects
This commit fixes an issue where the `tags` key of pins in the API response would be serialized as the string `"<map object at 0x...>". This issue would cause a `TypeError: pins.objects[i].tags.sort is not a function` on the frontend and prevent the page from loading.
This commit is contained in:
@@ -122,7 +122,7 @@ class PinResource(ModelResource):
|
|||||||
return bundle
|
return bundle
|
||||||
|
|
||||||
def dehydrate_tags(self, bundle):
|
def dehydrate_tags(self, bundle):
|
||||||
return map(str, bundle.obj.tags.all())
|
return list(map(str, bundle.obj.tags.all()))
|
||||||
|
|
||||||
def build_filters(self, filters=None):
|
def build_filters(self, filters=None):
|
||||||
orm_filters = super(PinResource, self).build_filters(filters)
|
orm_filters = super(PinResource, self).build_filters(filters)
|
||||||
|
|||||||
Reference in New Issue
Block a user