Merge pull request #1304 from xiaost/fix-no-cursor-timeout

Fix no_cursor_timeout with pymongo3
This commit is contained in:
Omer Katz 2016-05-29 10:15:20 +03:00
commit 3469ed7ab9

View File

@ -1462,7 +1462,7 @@ class BaseQuerySet(object):
msg = "The snapshot option is not anymore available with PyMongo 3+" msg = "The snapshot option is not anymore available with PyMongo 3+"
warnings.warn(msg, DeprecationWarning) warnings.warn(msg, DeprecationWarning)
cursor_args = { cursor_args = {
'no_cursor_timeout': self._timeout 'no_cursor_timeout': not self._timeout
} }
if self._loaded_fields: if self._loaded_fields:
cursor_args[fields_name] = self._loaded_fields.as_dict() cursor_args[fields_name] = self._loaded_fields.as_dict()