From 087b4b00031fed52eeddf05ae36825cb498680f0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Oct 2014 09:11:48 -0500 Subject: Remove queryset specialization in JSON encoder Signed-off-by: Dan McGee --- releng/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'releng') diff --git a/releng/views.py b/releng/views.py index ef81a65c..dbb65c2e 100644 --- a/releng/views.py +++ b/releng/views.py @@ -247,9 +247,6 @@ class ReleaseJSONEncoder(DjangoJSONEncoder): 'created', 'md5_sum', 'sha1_sum') def default(self, obj): - if hasattr(obj, '__iter__'): - # mainly for queryset serialization - return list(obj) if isinstance(obj, Release): data = {attr: getattr(obj, attr) or None for attr in self.release_attributes} @@ -276,7 +273,7 @@ def releases_json(request): data = { 'version': 1, - 'releases': releases, + 'releases': list(releases), 'latest_version': latest_version, } to_json = json.dumps(data, ensure_ascii=False, cls=ReleaseJSONEncoder) -- cgit v1.2.3-54-g00ecf