Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Make sure we are not assigning None as the jar.
Browse files Browse the repository at this point in the history
If the parent is not yet added to a jar, then the sub-object is safe too,
since the first time the parent is stored, the sub-obejct will receive the jar.
  • Loading branch information
strichter committed Oct 9, 2013
1 parent e949ab5 commit 4a226ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mongopersist/serialize.py
Expand Up @@ -219,7 +219,8 @@ def get_state(self, obj, pobj=None, seen=None):
# added.
if getattr(obj, '_p_mongo_sub_object', False):
if obj._p_jar is None:
obj._p_jar = pobj._p_jar
if pobj._p_jar is not None:
obj._p_jar = pobj._p_jar
obj._p_mongo_doc_object = pobj

if isinstance(obj, (tuple, list, PersistentList)):
Expand Down

0 comments on commit 4a226ab

Please sign in to comment.