Replaced slow exception handling with has_key.
This commit is contained in:
parent
95efa39b52
commit
e0911a5fe0
@ -415,11 +415,8 @@ class BaseDocument(object):
|
||||
self._meta.get('allow_inheritance', True) == False):
|
||||
data['_cls'] = self._class_name
|
||||
data['_types'] = self._superclasses.keys() + [self._class_name]
|
||||
try:
|
||||
if not data['_id']:
|
||||
del data['_id']
|
||||
except KeyError:
|
||||
pass
|
||||
if data.has_key('_id') and not data['_id']:
|
||||
del data['_id']
|
||||
return data
|
||||
|
||||
@classmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user