Commit 04ac2b75 by Rafael Monnerat

Prevent raise if business template is not installed

If Business Template is not present, returns None.
1 parent 00429f2b
......@@ -172,7 +172,9 @@ class TemplateTool (BaseTool):
given
"""
bt = self.getInstalledBusinessTemplate(title)
return bt.getRevision()
if bt is not None:
return bt.getRevision()
return None
def getBuiltBusinessTemplatesList(self):
"""Deprecated.
......
......@@ -281,6 +281,9 @@ class TestTemplateTool(ERP5TypeTestCase):
self.assertTrue(300 < self.getPortal()\
.portal_templates.getInstalledBusinessTemplateRevision('erp5_core'))
self.assertEquals(None, self.getPortal()\
.portal_templates.getInstalledBusinessTemplateRevision('erp5_toto'))
def test_getInstalledBusinessTemplateList(self):
templates_tool = self.getPortal().portal_templates
bt5_list = templates_tool.getInstalledBusinessTemplateList()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!