From 1acbc29d580e7f36552c838d83ec3b80419d51da Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 27 Jul 2016 15:39:46 +0100 Subject: [PATCH] Minor style tweak. [ci skip] --- rest_framework/schemas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index cdf2d5f3e..ee99a1c45 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -251,11 +251,11 @@ class SchemaGenerator(object): if method not in ('PUT', 'PATCH', 'POST'): return [] - fields = [] - - if not (hasattr(view, 'get_serializer_class') and callable(getattr(view, 'get_serializer_class'))): + if not hasattr(view, 'get_serializer_class'): return [] + fields = [] + serializer_class = view.get_serializer_class() serializer = serializer_class()