Fix issue #1286 and #844.: when building a query set from filters that reference the same field several times, do not assume each value is a dict

This commit is contained in:
Tal Yalon
2018-06-22 14:16:17 +03:00
parent 3cb6a5cfac
commit 080226dd72
2 changed files with 9 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ def query(_doc_cls=None, **kwargs):
if op is None or key not in mongo_query:
mongo_query[key] = value
elif key in mongo_query:
if isinstance(mongo_query[key], dict):
if isinstance(mongo_query[key], dict) and isinstance(value, dict):
mongo_query[key].update(value)
# $max/minDistance needs to come last - convert to SON
value_dict = mongo_query[key]