Commit eeb49616 authored by Jérome Perrin's avatar Jérome Perrin

In r23242, the type of the portal was tested instead of the type of the...

In r23242, the type of the portal was tested instead of the type of the context. Restore this and add some comments about how this script should behave when deleting templates inside a preference.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23752 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec9b613d
......@@ -116,6 +116,8 @@ elif uids is not None:\n
history_dict = object.Base_getWorkflowHistory()\n
history_dict.pop(\'edit_workflow\', None)\n
if history_dict == {} or object.aq_parent.portal_type==\'Preference\':\n
# templates inside preference will be unconditionnaly physically\n
# deleted\n
object_to_remove_list.append(object)\n
else:\n
# If a workflow manage a history, \n
......@@ -125,7 +127,9 @@ elif uids is not None:\n
# Remove some objects\n
try:\n
if object_to_remove_list != []:\n
if portal.portal_type==\'Preference\':\n
if context.portal_type == \'Preference\':\n
# Templates inside preference are not indexed, so we cannot pass\n
# uids= to manage_delObjects and have to use ids=\n
context.manage_delObjects(\n
ids=[x.getId() for x in object_to_remove_list],\n
REQUEST=REQUEST)\n
......
963
\ No newline at end of file
964
\ 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