Commit b2ecb041 authored by Vincent Pelletier's avatar Vincent Pelletier

Improve _install method "pythonicity".


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19377 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent af6328ad
......@@ -4530,7 +4530,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
trashbin = None
# Install everything
if len(object_to_update) > 0 or force:
if len(object_to_update) or force:
for item_name in self._item_name_list:
item = getattr(self, item_name, None)
if item is not None:
......@@ -4551,14 +4551,13 @@ Business Template is a set of definitions, such as skins, portal types and categ
# get objects to remove
# do remove after because we may need backup object from installation
remove_object_dict = {}
for path in object_to_update.keys():
action = object_to_update[path]
if action == 'remove' or action == 'save_and_remove':
for path, action in object_to_update.iteritems():
if action in ('remove', 'save_and_remove'):
remove_object_dict[path] = action
object_to_update.pop(path)
# remove object from old business template
if len(remove_object_dict) > 0:
if len(remove_object_dict):
for item_name in installed_bt._item_name_list:
item = getattr(installed_bt, item_name, None)
if item is not None:
......
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