mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-17 03:51:03 +03:00
WORKAROUND: avoid errors like "AttributeError: 'APIRoot' object has no attribute 'get_serializer'"
This commit is contained in:
parent
b915c1d4d8
commit
a91841f7fe
|
@ -80,6 +80,8 @@ class APIView(View):
|
||||||
self.check_permissions(cloned_request)
|
self.check_permissions(cloned_request)
|
||||||
|
|
||||||
# TODO: find right placement - APIView does not have get_serializer
|
# TODO: find right placement - APIView does not have get_serializer
|
||||||
|
if not hasattr(self, 'get_serializer'):
|
||||||
|
continue
|
||||||
serializer = self.get_serializer()
|
serializer = self.get_serializer()
|
||||||
if serializer is not None:
|
if serializer is not None:
|
||||||
field_name_types = {}
|
field_name_types = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user