This commit is contained in:
j0hnsmith 2017-06-06 15:24:10 +00:00 committed by GitHub
commit d2e7617a1f

View File

@ -1039,7 +1039,7 @@ class ModelSerializer(Serializer):
set of fields, but also takes into account the `Meta.fields` or
`Meta.exclude` options if they have been specified.
"""
fields = getattr(self.Meta, 'fields', None)
fields = getattr(self.Meta, 'fields', getattr(self.Meta, 'include', None))
exclude = getattr(self.Meta, 'exclude', None)
if fields and fields != ALL_FIELDS and not isinstance(fields, (list, tuple)):