Commit 0d0b3d6b authored by iv's avatar iv

ERP5Workflow: fix infinite loop because of variable renaming

the only way to escape the 'while 1' loop was depending on changes on the state
variable, which was, before this fix, using the invariant tdef instead of
transition
parent e0b58aa3
...@@ -323,13 +323,14 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -323,13 +323,14 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
def _changeStateOf(self, document, tdef=None, kwargs=None): def _changeStateOf(self, document, tdef=None, kwargs=None):
''' '''
Changes state. Can execute multiple transitions if there are Changes state. Can execute multiple transitions if there are
automatic transitions. tdef set to None means the object automatic transitions. transition set to None means the object
was just created. was just created.
''' '''
moved_exc = None moved_exc = None
transition = tdef
while 1: while 1:
try: try:
state = self._executeTransition(document, tdef, kwargs) state = self._executeTransition(document, transition, kwargs)
except ObjectMoved, moved_exc: except ObjectMoved, moved_exc:
document = moved_exc.getNewObject() document = moved_exc.getNewObject()
state = self._getWorkflowStateOf(document, id_only=0) state = self._getWorkflowStateOf(document, id_only=0)
......
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