Commit 5bf678f7 authored by Romain Courteaud's avatar Romain Courteaud

Use _updateProperty method to modify existing property

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29145 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2400bcc0
No related merge requests found
...@@ -1388,17 +1388,26 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem): ...@@ -1388,17 +1388,26 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem):
'business_template_registered_skin_selections', None) 'business_template_registered_skin_selections', None)
if selection_string is None: if selection_string is None:
create_property = True
selection_string = self._objects[skin_folder_id].replace(',', ' ') selection_string = self._objects[skin_folder_id].replace(',', ' ')
else: else:
create_property = False
if not isinstance(selection_string, basestring):
selection_string = ' '.join(selection_string)
selection_string += ' %s' % \ selection_string += ' %s' % \
self._objects[skin_folder_id].replace(',', ' ') self._objects[skin_folder_id].replace(',', ' ')
# Remove duplicate # Remove duplicate
selection_string = \ selection_string = \
' '.join(dict([(x, 0) for x in selection_string.split(' ')]).keys()) ' '.join(dict([(x, 0) for x in selection_string.split(' ')]).keys())
if create_property:
skin_folder._setProperty( skin_folder._setProperty(
'business_template_registered_skin_selections', 'business_template_registered_skin_selections',
selection_string.split(' '), type='tokens') selection_string.split(' '), type='tokens')
else:
skin_folder._updateProperty(
'business_template_registered_skin_selections',
selection_string.split(' '))
selection_list = selection_string.split(' ') selection_list = selection_string.split(' ')
unregisterSkinFolder(skin_tool, skin_folder, unregisterSkinFolder(skin_tool, skin_folder,
...@@ -1428,7 +1437,7 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem): ...@@ -1428,7 +1437,7 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem):
current_selection_list = list(current_selection_set) current_selection_list = list(current_selection_set)
if current_selection_list: if current_selection_list:
skin_folder.setProperty( skin_folder._updateProperty(
'business_template_registered_skin_selections', 'business_template_registered_skin_selections',
current_selection_list) current_selection_list)
......
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