handle corner case of content rule of changing id on cut/paste (#4559)

This commit is contained in:
Frédéric Péters 2014-03-24 14:24:02 +01:00
parent 656cc50f65
commit fe8b9c2045
1 changed files with 4 additions and 1 deletions

View File

@ -171,7 +171,10 @@ def addContentToContainer(container, object, checkConstraints=True):
if HAS_UUID:
# work around edge case where a content rule may have moved the item
uuid = IUUID(object)
return uuidToObject(uuid)
try:
return uuidToObject(uuid)
except KeyError:
return None
else:
# no way to know where it is
raise