Skip to content

Commit

Permalink
attempt to fix MongoEngine#1086, testable with MongoEngine#1072
Browse files Browse the repository at this point in the history
  • Loading branch information
gordol committed Apr 23, 2016
1 parent cbd2a44 commit 935e503
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mongoengine/queryset/queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def _iter_results(self):
yield self._result_cache[pos]
pos = pos + 1
if not self._has_more:
raise StopIteration
if pos == len(self):
raise StopIteration
if len(self._result_cache) <= pos:
self._populate_cache()

Expand Down Expand Up @@ -161,4 +162,4 @@ class QuerySetNoDeRef(QuerySet):
"""Special no_dereference QuerySet"""

def __dereference(items, max_depth=1, instance=None, name=None):
return items
return items

0 comments on commit 935e503

Please sign in to comment.