aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorNikolaus Schlemm2013-05-19 11:29:41 +0200
committerNikolaus Schlemm2013-05-19 11:29:41 +0200
commita91841f7fe91f79a18a1f4f0352ec3e07f389a0a (patch)
treeadc0f769905b5a0135b6d9cadace4f9ed387b870 /rest_framework/views.py
parentb915c1d4d81fc459ed7c79ee5264ef7467963c3f (diff)
downloaddjango-rest-framework-a91841f7fe91f79a18a1f4f0352ec3e07f389a0a.tar.bz2
WORKAROUND: avoid errors like "AttributeError: 'APIRoot' object has no attribute 'get_serializer'"
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index e8bd9f50..6348ca88 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -80,6 +80,8 @@ class APIView(View):
self.check_permissions(cloned_request)
# TODO: find right placement - APIView does not have get_serializer
+ if not hasattr(self, 'get_serializer'):
+ continue
serializer = self.get_serializer()
if serializer is not None:
field_name_types = {}