Commit 9215f86f authored by Jérome Perrin's avatar Jérome Perrin

related documents in portal_trash should not prevent from deleting a document

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14547 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b105d8c4
...@@ -85,14 +85,17 @@ REQUEST=context.REQUEST\n ...@@ -85,14 +85,17 @@ REQUEST=context.REQUEST\n
qs = \'\'\n qs = \'\'\n
ret_url = \'\'\n ret_url = \'\'\n
\n \n
def Object_hasRelation(object):\n def Object_hasRelation(obj):\n
# Check if there is some related objets.\n # Check if there is some related objets.\n
result = 0\n result = 0\n
for o in object.getIndexableChildValueList():\n for o in obj.getIndexableChildValueList():\n
for related in object.portal_categories.getRelatedValueList(o):\n for related in obj.portal_categories.getRelatedValueList(o):\n
if related.getRelativeUrl().startswith(object.getRelativeUrl()):\n related_url = related.getRelativeUrl()\n
if related_url.startswith(obj.getRelativeUrl()):\n
continue\n continue\n
elif related.getRelativeUrl().startswith(\'portal_simulation\') :\n elif related_url.startswith(\'portal_simulation\'):\n
continue\n
elif related_url.startswith(\'portal_trash\'):\n
continue\n continue\n
else:\n else:\n
result = 1\n result = 1\n
...@@ -135,14 +138,14 @@ elif uids is not None:\n ...@@ -135,14 +138,14 @@ elif uids is not None:\n
object_to_delete_list.append(object)\n object_to_delete_list.append(object)\n
\n \n
# Remove some objects\n # Remove some objects\n
try: \n try:\n
if object_to_remove_list != []:\n if object_to_remove_list != []:\n
context.manage_delObjects(\n context.manage_delObjects(\n
uids=[x.getUid() for x in object_to_remove_list],\n uids=[x.getUid() for x in object_to_remove_list],\n
REQUEST=REQUEST)\n REQUEST=REQUEST)\n
except ConflictError: \n except ConflictError:\n
raise\n raise\n
except Exception, message : \n except Exception, message:\n
qs = \'?portal_status_message=%s\' % message\n qs = \'?portal_status_message=%s\' % message\n
else:\n else:\n
object_ids = [x.getId() for x in object_to_remove_list]\n object_ids = [x.getId() for x in object_to_remove_list]\n
......
338 339
\ No newline at end of file \ No newline at end of file
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