Commit 47a6f5e3 authored by iv's avatar iv

ERP5Workflow: rename variables

parent b6724253
...@@ -329,15 +329,15 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -329,15 +329,15 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
moved_exc = None moved_exc = None
while 1: while 1:
try: try:
sdef = self._executeTransition(document, tdef, kwargs) state = self._executeTransition(document, tdef, kwargs)
except ObjectMoved, moved_exc: except ObjectMoved, moved_exc:
document = moved_exc.getNewObject() document = moved_exc.getNewObject()
sdef = self._getWorkflowStateOf(document, id_only=0) state = self._getWorkflowStateOf(document, id_only=0)
# Re-raise after all transitions. # Re-raise after all transitions.
if sdef is None: if state is None:
break break
tdef = self._findAutomaticTransition(document, sdef) transition = self._findAutomaticTransition(document, state)
if tdef is None: if transition is None:
# No more automatic transitions. # No more automatic transitions.
break break
# Else continue. # Else continue.
...@@ -689,7 +689,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -689,7 +689,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
object.REQUEST.other.update(form_kw) object.REQUEST.other.update(form_kw)
kwargs = form_kw kwargs = form_kw
# XXX(WORKFLOW) check this for loop
for vdef in self.objectValues(portal_type='Workflow Variable'): for vdef in self.objectValues(portal_type='Workflow Variable'):
id = vdef.getId() id = vdef.getId()
variable_reference = vdef.getReference() variable_reference = vdef.getReference()
...@@ -709,7 +708,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -709,7 +708,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
expr = variable_expression expr = variable_expression
else: else:
value = vdef.getVariableValue(object=object) value = vdef.getVariableValue(object=object)
if expr is not None and expr != '': if expr not in(None, ''):
# Evaluate an expression. # Evaluate an expression.
if econtext is None: if econtext is None:
# Lazily create the expression context. # Lazily create the expression context.
......
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