Commit d806bdae authored by Julien Muchembled's avatar Julien Muchembled

Clean up TemplateTool.getDependencyList()

parent 5f4859aa
......@@ -878,19 +878,15 @@ class TemplateTool (BaseTool):
security.declareProtected(Permissions.AccessContentsInformation,
'getDependencyList')
@transactional_cached(lambda self, bt: bt)
def getDependencyList(self, bt):
"""
Return the list of missing dependencies for a business
template, given a tuple : (repository, id)
"""
# use by using "self" on transactional_cached decorator
# breaks ERP5Site creation due aq_base.
@transactional_cached(lambda bt: (bt))
def _getDependency(bt):
# We do not take into consideration the dependencies
# for meta business templates
if bt[0] == 'meta':
return []
# We do not take into consideration the dependencies
# for meta business templates
if bt[0] != 'meta':
result_list = []
for repository, property_dict_list in self.repository_dict.items():
if repository == bt[0]:
......@@ -920,7 +916,7 @@ class TemplateTool (BaseTool):
except BusinessTemplateIsMeta:
provider_list = self.getProviderList(dependency)
for provider in provider_list:
if self.portal_templates.getInstalledBusinessTemplate(provider) is not None:
if self.getInstalledBusinessTemplate(provider) is not None:
bt_dep = self.getLastestBTOnRepos(provider)
break
if bt_dep is None:
......@@ -932,8 +928,7 @@ class TemplateTool (BaseTool):
result_list.append(bt_dep)
return result_list
raise BusinessTemplateUnknownError, 'The Business Template %s could not be found on repository %s'%(bt[1], bt[0])
return _getDependency(bt)
return []
def findProviderInBTList(self, provider_list, bt_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