workflows: remove unnecessary handling of exception in timeout_parse (#83418)
This commit is contained in:
parent
5365983716
commit
617e170a92
|
@ -272,6 +272,13 @@ def test_timeout(pub):
|
|||
jump.status = 'st2'
|
||||
workflow.store()
|
||||
|
||||
# test timeout_parse
|
||||
assert jump.timeout_parse(None) is None # no value, kept as is
|
||||
assert jump.timeout_parse('') == '' # no value, kept as is
|
||||
assert jump.timeout_parse('20 minutes') == 20 * 60
|
||||
assert jump.timeout_parse('20') == 0 # not unit
|
||||
assert jump.timeout_parse('error') == 0 # not a valid value
|
||||
|
||||
formdef = FormDef()
|
||||
formdef.name = 'baz'
|
||||
formdef.fields = []
|
||||
|
|
|
@ -341,10 +341,7 @@ class JumpWorkflowStatusItem(WorkflowStatusJumpItem):
|
|||
return value
|
||||
if self.get_expression(value)['type'] != 'text':
|
||||
return value
|
||||
try:
|
||||
return humanduration2seconds(value)
|
||||
except ValueError:
|
||||
return None
|
||||
return humanduration2seconds(value)
|
||||
|
||||
def get_computed_strings(self):
|
||||
yield from super().get_computed_strings()
|
||||
|
|
Loading…
Reference in New Issue