Commit 61c0e69a by Colin Howe

Merge pull request #13 from brianz/master

Fix "$query" KeyError when using PyMongo 2.2+
parents b7a96405 3fdc8a77
...@@ -43,7 +43,7 @@ def _get_stacktrace(): ...@@ -43,7 +43,7 @@ def _get_stacktrace():
"Could not retrieve stack. IndexError exception occured in inspect.stack(). " "Could not retrieve stack. IndexError exception occured in inspect.stack(). "
"This error might occur when jinja2 templates is on the stack.", "This error might occur when jinja2 templates is on the stack.",
)] )]
return _tidy_stacktrace(reversed(stack)) return _tidy_stacktrace(reversed(stack))
else: else:
return [] return []
...@@ -168,7 +168,7 @@ def _cursor_refresh(cursor_self): ...@@ -168,7 +168,7 @@ def _cursor_refresh(cursor_self):
# Normal Query # Normal Query
query_data['skip'] = privar('skip') query_data['skip'] = privar('skip')
query_data['limit'] = privar('limit') query_data['limit'] = privar('limit')
query_data['query'] = query_son['$query'] query_data['query'] = query_son.get('$query')
query_data['ordering'] = _get_ordering(query_son) query_data['ordering'] = _get_ordering(query_son)
queries.append(query_data) queries.append(query_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment