Commit 70324182 authored by iv's avatar iv

ERP5Workflow: if status value is None, don't change it to empty string!

in the Workflow, the status dict (used to set history) can handle None
values, and the behaviour should not differ from DCWorkflow.

This should fix SyncML test failures.
parent 01646bd8
...@@ -902,7 +902,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -902,7 +902,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
addable = WORKFLOW_ACTION_ADDABLE addable = WORKFLOW_ACTION_ADDABLE
time = status.get('time') time = status.get('time')
for action in action_list: for action in action_list:
this_one = WORKFLOW_ACTION_ADDABLE this_one = True
if time <= action.get('time'): if time <= action.get('time'):
# action in the past are not appended # action in the past are not appended
addable = WORKFLOW_ACTION_INSERTABLE addable = WORKFLOW_ACTION_INSERTABLE
...@@ -910,7 +910,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -910,7 +910,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
key_list.remove("time") key_list.remove("time")
for key in key_list: for key in key_list:
if status[key] != action[key]: if status[key] != action[key]:
this_one = WORKFLOW_ACTION_NOT_ADDABLE this_one = False
break break
if this_one: if this_one:
addable = WORKFLOW_ACTION_NOT_ADDABLE addable = WORKFLOW_ACTION_NOT_ADDABLE
......
...@@ -717,7 +717,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -717,7 +717,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
econtext = createExprContext(sci) econtext = createExprContext(sci)
expr = Expression(expr) expr = Expression(expr)
value = expr(econtext) value = expr(econtext)
if value is None: value = ''
status_dict[variable_reference] = value status_dict[variable_reference] = value
# Do not proceed in case of failure of before script # Do not proceed in case of failure of before script
if not before_script_success: if not before_script_success:
......
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