Skip to content
Snippets Groups Projects
Unverified Commit 9301a8d5 authored by Harsha Kethineni's avatar Harsha Kethineni Committed by GitHub
Browse files

Merge pull request #981 from scitran/bson-errors

bson.InvalidId -> bson.errors.InvalidId
parents df6f68e0 3431fb89
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,7 @@ class ContainerStorage(object):
if self.use_object_id:
try:
_id = bson.ObjectId(_id)
except bson.InvalidId as e:
except bson.errors.InvalidId as e:
raise APIStorageException(e.message)
if recursive and r_payload is not None:
containerutil.propagate_changes(self.cont_name, _id, {}, {'$set': util.mongo_dict(r_payload)})
......@@ -165,7 +165,7 @@ class ContainerStorage(object):
if self.use_object_id:
try:
_id = bson.ObjectId(_id)
except bson.InvalidId as e:
except bson.errors.InvalidId as e:
raise APIStorageException(e.message)
return self.dbc.delete_one({'_id':_id})
......@@ -173,7 +173,7 @@ class ContainerStorage(object):
if self.use_object_id:
try:
_id = bson.ObjectId(_id)
except bson.InvalidId as e:
except bson.errors.InvalidId as e:
raise APIStorageException(e.message)
cont = self._from_mongo(self.dbc.find_one(_id, projection))
if fill_defaults:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment