Commit 76710ef1 authored by Aurel's avatar Aurel

get object if not already get when checking portal types


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5470 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37d309b7
...@@ -72,6 +72,7 @@ class TrashTool(BaseTool): ...@@ -72,6 +72,7 @@ class TrashTool(BaseTool):
# backup the object # backup the object
# here we choose export/import to copy because cut/paste # here we choose export/import to copy because cut/paste
# do too many things and check for what we want to do # do too many things and check for what we want to do
obj = None
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]
...@@ -95,6 +96,8 @@ class TrashTool(BaseTool): ...@@ -95,6 +96,8 @@ class TrashTool(BaseTool):
LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id)) LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id))
pass pass
# in case of portal types, export properties instead of subobjects # in case of portal types, export properties instead of subobjects
if obj is None:
obj = self.unrestrictedTraverse(object_path)
if getattr(obj, 'meta_type', None) == 'ERP5 Type Information': if getattr(obj, 'meta_type', None) == 'ERP5 Type Information':
subobjects_dict = {} subobjects_dict = {}
subobjects_dict['allowed_content_type_list'] = getattr(obj, 'allowed_content_types', []) or [] subobjects_dict['allowed_content_type_list'] = getattr(obj, 'allowed_content_types', []) or []
......
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