workflows: make sure anchor expression is imported as a string (#39360)
This commit is contained in:
parent
674ca5b687
commit
8b51e62e1e
|
@ -628,6 +628,19 @@ def test_global_timeout_trigger(pub):
|
|||
assert wf2.global_actions[0].triggers[-1].anchor == trigger.anchor
|
||||
|
||||
|
||||
def test_global_anchor_expression_trigger(pub):
|
||||
wf = Workflow(name='global actions')
|
||||
ac1 = wf.add_global_action('Action', 'ac1')
|
||||
trigger = ac1.append_trigger('timeout')
|
||||
trigger.anchor_expression = 'False'
|
||||
trigger.anchor = 'python'
|
||||
|
||||
wf2 = assert_import_export_works(wf, include_id=True)
|
||||
assert wf2.global_actions[0].triggers[-1].id == trigger.id
|
||||
assert wf2.global_actions[0].triggers[-1].anchor == trigger.anchor
|
||||
assert wf2.global_actions[0].triggers[-1].anchor_expression == trigger.anchor_expression
|
||||
|
||||
|
||||
def test_global_webservice_trigger(pub):
|
||||
wf = Workflow(name='global actions')
|
||||
ac1 = wf.add_global_action('Action', 'ac1')
|
||||
|
|
|
@ -889,7 +889,8 @@ class XmlSerialisable(object):
|
|||
else:
|
||||
if el.text is None:
|
||||
setattr(self, attribute, None)
|
||||
elif el.text in ('False', 'True'): # bools
|
||||
elif el.text in ('False', 'True') and not isinstance(getattr(self, attribute), six.string_types):
|
||||
# booleans
|
||||
setattr(self, attribute, el.text == 'True')
|
||||
elif type(getattr(self, attribute)) is int:
|
||||
setattr(self, attribute, int(el.text))
|
||||
|
@ -1041,7 +1042,7 @@ class WorkflowGlobalActionTimeoutTriggerMarker(object):
|
|||
class WorkflowGlobalActionTimeoutTrigger(WorkflowGlobalActionTrigger):
|
||||
key = 'timeout'
|
||||
anchor = None
|
||||
anchor_expression = None
|
||||
anchor_expression = ''
|
||||
anchor_status_first = None
|
||||
anchor_status_latest = None
|
||||
timeout = None
|
||||
|
|
Loading…
Reference in New Issue