From dc1613fc7003804bed65e3a7d5afb0ef17d158ca Mon Sep 17 00:00:00 2001 From: Bruno Rocha Date: Sun, 23 Aug 2015 23:05:22 -0300 Subject: [PATCH] Fix #153 privar() return None when attr is not found --- flask_mongoengine/operation_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_mongoengine/operation_tracker.py b/flask_mongoengine/operation_tracker.py index 18340933..7b2575ff 100644 --- a/flask_mongoengine/operation_tracker.py +++ b/flask_mongoengine/operation_tracker.py @@ -133,7 +133,7 @@ def _remove(collection_self, spec_or_id, safe=None, **kwargs): def _cursor_refresh(cursor_self): # Look up __ private instance variables def privar(name): - return getattr(cursor_self, '_Cursor__{0}'.format(name)) + return getattr(cursor_self, '_Cursor__{0}'.format(name), None) if privar('id') is not None: # getMore not query - move on