Commit 92744996 authored by Aurel's avatar Aurel

imporve preinstall method of roles for action reinstall


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4956 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a0d2b8aa
......@@ -1125,7 +1125,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
portal = context.getPortalObject()
new_keys = self._objects.keys()
if installed_bt.id == 'installed_bt_for_diff':
#must rename keys in dict
#must rename keys in dict if reinstall
new_dict = PersistentMapping()
for key in installed_bt._objects.keys():
new_key = self.class_property+'/'+key
......@@ -1969,6 +1969,13 @@ class RoleTemplateItem(BaseTemplateItem):
modified_object_list = {}
if context.getTemplateFormatVersion() == 1:
new_roles = self._objects.keys()
if installed_bt.id == 'installed_bt_for_diff':
#must rename keys in dict if reinstall
new_dict = PersistentMapping()
old_keys = installed_bt._objects.values()[0]
for key in old_keys:
new_dict[key] = ''
installed_bt._objects = new_dict
for role in new_roles:
if installed_bt._objects.has_key(role):
continue
......
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