Commit a4c18ad3 authored by Romain Courteaud's avatar Romain Courteaud

WIP TemplateTool: draft bt5 crashes

parent f8d4f774
...@@ -133,13 +133,17 @@ class TemplateTool (BaseTool): ...@@ -133,13 +133,17 @@ class TemplateTool (BaseTool):
if state == 'installed': if state == 'installed':
return bt return bt
if state == 'not_installed': if state == 'not_installed':
last_transition = bt.workflow_history \ try:
['business_template_installation_workflow'][-1] last_transition = bt.workflow_history \
if last_transition['action'] == 'uninstall': # There is not uninstalled state ! ['business_template_installation_workflow'][-1]
t = last_transition['time'] except TypeError:
if last_time < t: continue
last_bt = None else:
last_time = t if last_transition['action'] == 'uninstall': # There is not uninstalled state !
t = last_transition['time']
if last_time < t:
last_bt = None
last_time = t
elif state == 'replaced' and not strict: elif state == 'replaced' and not strict:
t = bt.workflow_history \ t = bt.workflow_history \
['business_template_installation_workflow'][-1]['time'] ['business_template_installation_workflow'][-1]['time']
......
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