From df4b63de233470eb3d191baf19d67314243d1e0c Mon Sep 17 00:00:00 2001 From: Carey Metcalfe Date: Tue, 3 Apr 2018 09:08:50 -0400 Subject: [PATCH] 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 `"". This issue would cause a `TypeError: pins.objects[i].tags.sort is not a function` on the frontend and prevent the page from loading. --- core/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/api.py b/core/api.py index be03038..40209b3 100644 --- a/core/api.py +++ b/core/api.py @@ -122,7 +122,7 @@ class PinResource(ModelResource): return 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): orm_filters = super(PinResource, self).build_filters(filters)