diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 8bb28e3f8b..9dfb90f769 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -681,9 +681,7 @@ def to_representation(self, data): """ # Dealing with nested relationships, data can be a Manager, # so, first get a queryset from the Manager if needed - iterable = data.all() if isinstance(data, ( - models.manager.Manager, models.manager.BaseManager - )) else data + iterable = data.all() if isinstance(data, models.manager.BaseManager) else data return [ self.child.to_representation(item) for item in iterable