Commit 85830ff2 authored by Jérome Perrin's avatar Jérome Perrin

When uninstalling an action, catch the error and continue installing when the action is not found.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5618 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0153f990
...@@ -1732,12 +1732,16 @@ class ActionTemplateItem(ObjectTemplateItem): ...@@ -1732,12 +1732,16 @@ class ActionTemplateItem(ObjectTemplateItem):
key = 'id' key = 'id'
else: else:
relative_url, key, value = self._splitPath(id) relative_url, key, value = self._splitPath(id)
obj = p.unrestrictedTraverse(relative_url) obj = p.unrestrictedTraverse(relative_url, None)
if obj is not None:
action_list = obj.listActions() action_list = obj.listActions()
for index in range(len(action_list)): for index in range(len(action_list)):
if getattr(action_list[index], key) == value: if getattr(action_list[index], key) == value:
obj.deleteActions(selections=(index,)) obj.deleteActions(selections=(index,))
break break
else :
LOG('BusinessTemplate', 100,
'unable to uninstall action at %s, ignoring' % relative_url )
BaseTemplateItem.uninstall(self, context, **kw) BaseTemplateItem.uninstall(self, context, **kw)
class PortalTypeRolesTemplateItem(BaseTemplateItem): class PortalTypeRolesTemplateItem(BaseTemplateItem):
......
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