From fe8b9c20455b7433a36c54c8f0e355c9d0ae5bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 24 Mar 2014 14:24:02 +0100 Subject: [PATCH] handle corner case of content rule of changing id on cut/paste (#4559) --- plone/dexterity/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plone/dexterity/utils.py b/plone/dexterity/utils.py index a2eb274..1155fcf 100644 --- a/plone/dexterity/utils.py +++ b/plone/dexterity/utils.py @@ -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