Fix BaseDocument._delta when working with plain ObjectIds instead of DBRefs
This commit is contained in:
parent
2ad5ffbda2
commit
e27439be6a
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ import numbers
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
import pymongo
|
import pymongo
|
||||||
from bson import json_util
|
from bson import json_util, ObjectId
|
||||||
from bson.dbref import DBRef
|
from bson.dbref import DBRef
|
||||||
from bson.son import SON
|
from bson.son import SON
|
||||||
|
|
||||||
|
|
@ -454,7 +454,7 @@ class BaseDocument(object):
|
||||||
d = doc
|
d = doc
|
||||||
new_path = []
|
new_path = []
|
||||||
for p in parts:
|
for p in parts:
|
||||||
if isinstance(d, DBRef):
|
if isinstance(d, (ObjectId, DBRef)):
|
||||||
break
|
break
|
||||||
elif isinstance(d, list) and p.isdigit():
|
elif isinstance(d, list) and p.isdigit():
|
||||||
d = d[int(p)]
|
d = d[int(p)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue