Allow 0 or "" to be used as valid _id value.
This commit is contained in:
parent
69989365c7
commit
a68cb20266
@ -442,7 +442,7 @@ class BaseDocument(object):
|
||||
self._meta.get('allow_inheritance', True) == False):
|
||||
data['_cls'] = self._class_name
|
||||
data['_types'] = self._superclasses.keys() + [self._class_name]
|
||||
if data.has_key('_id') and not data['_id']:
|
||||
if data.has_key('_id') and data['_id'] is None:
|
||||
del data['_id']
|
||||
return data
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user