From a91841f7fe91f79a18a1f4f0352ec3e07f389a0a Mon Sep 17 00:00:00 2001 From: Nikolaus Schlemm Date: Sun, 19 May 2013 11:29:41 +0200 Subject: [PATCH] WORKAROUND: avoid errors like "AttributeError: 'APIRoot' object has no attribute 'get_serializer'" --- rest_framework/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/views.py b/rest_framework/views.py index e8bd9f505..6348ca885 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 = {}