Avoids redundant filtering with non-nested nodes.

This commit is contained in:
Pablo Chinea 2017-02-23 14:24:25 +00:00
parent 328cd50821
commit 7f471252da

View File

@ -49,7 +49,8 @@ class DjangoConnectionField(ConnectionField):
iterable = default_manager iterable = default_manager
iterable = maybe_queryset(iterable) iterable = maybe_queryset(iterable)
if isinstance(iterable, QuerySet): if isinstance(iterable, QuerySet):
iterable &= maybe_queryset(default_manager) if iterable is not default_manager:
iterable &= maybe_queryset(default_manager)
_len = iterable.count() _len = iterable.count()
else: else:
_len = len(iterable) _len = len(iterable)