Commit d7f0e54d authored by Arnaud Fontaine's avatar Arnaud Fontaine

The Form class must be re-created after the first attempts otherwise an

ExpiredError is raised as the content is outdated



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@46028 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4d3e7ee7
...@@ -796,8 +796,8 @@ class ContextMainForm(MainForm): ...@@ -796,8 +796,8 @@ class ContextMainForm(MainForm):
else: else:
current_attempt_counter = 0 current_attempt_counter = 0
while current_attempt_counter != maximum_attempt_number: while current_attempt_counter != maximum_attempt_number:
self.submitSelect('select_jump', 'Base_doJump:method', self.browser.mainForm.submitSelect('select_jump', 'Base_doJump:method',
label, value, **kw) label, value, **kw)
if no_jump_transition_message != self.browser.getTransitionMessage(): if no_jump_transition_message != self.browser.getTransitionMessage():
return current_attempt_counter * sleep_between_attempt return current_attempt_counter * sleep_between_attempt
...@@ -909,15 +909,14 @@ class ContextMainForm(MainForm): ...@@ -909,15 +909,14 @@ class ContextMainForm(MainForm):
""" """
def tryLegacyAndNew(): def tryLegacyAndNew():
try: try:
self.submitSelect('select_action', 'Base_doAction:method', label, self.browser.mainForm.submitSelect(
value and '%s?workflow_action=%s' % (script_id, value), 'select_action', 'Base_doAction:method', label,
**kw) value and '%s?workflow_action=%s' % (script_id, value), **kw)
except LookupError: except LookupError:
self.submitSelect('select_action', 'Base_doAction:method', label, self.browser.mainForm.submitSelect(
value and '%s?field_my_workflow_action=%s' % (script_id, 'select_action', 'Base_doAction:method', label,
value), value and '%s?field_my_workflow_action=%s' % (script_id, value), **kw)
**kw)
if maximum_attempt_number == 1: if maximum_attempt_number == 1:
tryLegacyAndNew() tryLegacyAndNew()
......
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