Commit 62e32406 authored by Nicolas Dumazet's avatar Nicolas Dumazet

simplify erp5_core specific code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42786 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 762c1872
...@@ -4719,15 +4719,15 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4719,15 +4719,15 @@ Business Template is a set of definitions, such as skins, portal types and categ
generator_class = getattr(site, '_generator_class', ERP5Generator) generator_class = getattr(site, '_generator_class', ERP5Generator)
gen = generator_class() gen = generator_class()
# update activity tool first if necessary # update activity tool first if necessary
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool(): if self.getTitle() == 'erp5_core':
gen.setupLastTools(site) if self.getTemplateUpdateTool():
if not force: gen.setupLastTools(site)
if len(object_to_update) == 0: if not force and len(object_to_update) == 0:
# check if we have to update tools # check if we have to update tools
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool(): if self.getTemplateUpdateTool():
LOG('Business Template', 0, 'Updating Tools') LOG('Business Template', 0, 'Updating Tools')
gen.setup(site, 0, update=1) gen.setup(site, 0, update=1)
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateBusinessTemplateWorkflow(): if self.getTemplateUpdateBusinessTemplateWorkflow():
LOG('Business Template', 0, 'Updating Business Template Workflows') LOG('Business Template', 0, 'Updating Business Template Workflows')
gen.setupWorkflow(site) gen.setupWorkflow(site)
return return
...@@ -4780,17 +4780,18 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4780,17 +4780,18 @@ Business Template is a set of definitions, such as skins, portal types and categ
# update tools if necessary # update tools if necessary
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool(): if self.getTitle() == 'erp5_core':
LOG('Business Template', 0, 'Updating Tools') if self.getTemplateUpdateTool():
gen.setup(site, 0, update=1) LOG('Business Template', 0, 'Updating Tools')
gen.setup(site, 0, update=1)
# check if we have to update business template workflow
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateBusinessTemplateWorkflow(): # check if we have to update business template workflow
LOG('Business Template', 0, 'Updating Business Template Workflows') if self.getTemplateUpdateBusinessTemplateWorkflow():
gen.setupWorkflow(site) LOG('Business Template', 0, 'Updating Business Template Workflows')
# XXX keep TM in case update of workflow doesn't work gen.setupWorkflow(site)
# self._v_txn = WorkflowUpdateTM() # XXX keep TM in case update of workflow doesn't work
# self._v_txn.register(update=1, gen=gen, site=site) # self._v_txn = WorkflowUpdateTM()
# self._v_txn.register(update=1, gen=gen, site=site)
# remove trashbin if empty # remove trashbin if empty
if trashbin is not None: if trashbin 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