diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index ba6a50a..7b3a3cc 100644
a
|
b
|
class Query(object):
|
1168 | 1168 | parts, opts, alias, can_reuse=can_reuse, allow_many=allow_many) |
1169 | 1169 | |
1170 | 1170 | # Prevent iterator from being consumed by check_related_objects() |
| 1171 | _value = value |
1171 | 1172 | if isinstance(value, Iterator): |
1172 | | value = list(value) |
1173 | | self.check_related_objects(field, value, opts) |
| 1173 | _value = list(value) |
| 1174 | self.check_related_objects(field, _value, opts) |
1174 | 1175 | |
1175 | 1176 | # split_exclude() needs to know which joins were generated for the |
1176 | 1177 | # lookup parts |