Commit 396cb756 authored by Łukasz Nowak's avatar Łukasz Nowak

Ignore manually deleted subobjects.

parent 4a474a34
...@@ -1240,7 +1240,10 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1240,7 +1240,10 @@ class ObjectTemplateItem(BaseTemplateItem):
container_path_list = recursive_path.split('/')[:-1] container_path_list = recursive_path.split('/')[:-1]
self._backupObject(action, trashbin, container_path_list, self._backupObject(action, trashbin, container_path_list,
document_id) document_id)
parent.manage_delObjects([document_id]) try:
parent.manage_delObjects([document_id])
except BadRequest:
pass # subobject removed manually
else: else:
# for old business template format # for old business template format
BaseTemplateItem.install(self, context, trashbin, **kw) BaseTemplateItem.install(self, context, trashbin, **kw)
......
...@@ -82,7 +82,7 @@ class TrashTool(BaseTool): ...@@ -82,7 +82,7 @@ class TrashTool(BaseTool):
if object_id not in backup_object_container.objectIds(): if object_id not in backup_object_container.objectIds():
# export object # export object
object_path = container_path + [object_id] object_path = container_path + [object_id]
obj = self.unrestrictedTraverse(object_path) obj = self.unrestrictedTraverse(object_path, None)
if obj is not None: if obj is not None:
connection = obj._p_jar connection = obj._p_jar
o = obj o = obj
...@@ -138,11 +138,10 @@ class TrashTool(BaseTool): ...@@ -138,11 +138,10 @@ class TrashTool(BaseTool):
if not keep_sub: if not keep_sub:
# export subobjects # export subobjects
if save: if save:
obj = backup_object_container._getOb(object_id) obj = backup_object_container._getOb(object_id, None)
object_path = list(obj.getPhysicalPath())
else: else:
object_path = container_path + [object_id] object_path = container_path + [object_id]
obj = self.unrestrictedTraverse(object_path) obj = self.unrestrictedTraverse(object_path, None)
if obj is not None: if obj is not None:
for subobject_id in list(obj.objectIds()): for subobject_id in list(obj.objectIds()):
subobject = obj.unrestrictedTraverse(subobject_id) subobject = obj.unrestrictedTraverse(subobject_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment