diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index c116cc72f..a404d4e04 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -324,7 +324,10 @@ class Serializer(BaseSerializer): @cached_property def _readable_fields(self): - return [field for field in self.fields.values() if not field.write_only] + return [ + field for field in self.fields.values() + if not field.write_only + ] def get_fields(self): """