Skip to content
Snippets Groups Projects
Commit f85e6365 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-2879: handle 'on hold' path to 'started'

parent fcd47dea
No related branches found
No related tags found
No related merge requests found
......@@ -135,8 +135,10 @@ def set_subtask_state_following_allowed_transitions(subtask: typing.Union[models
elif desired_state_value in (models.SubtaskState.Choices.ON_HOLD.value, models.SubtaskState.Choices.RESTARTING.value) and subtask.state.value == models.SubtaskState.Choices.STARTED.value:
subtask.state = models.SubtaskState.objects.get(value=models.SubtaskState.Choices.ON_HOLD.value)
# handle "partially successfull path" to restarting state
elif desired_state_value == models.SubtaskState.Choices.RESTARTING.value and subtask.state.value == models.SubtaskState.Choices.ON_HOLD.value:
elif desired_state_value in (models.SubtaskState.Choices.RESTARTING.value, models.SubtaskState.Choices.STARTED.value) and subtask.state.value == models.SubtaskState.Choices.ON_HOLD.value:
subtask.state = models.SubtaskState.objects.get(value=models.SubtaskState.Choices.RESTARTING.value)
elif desired_state_value == models.SubtaskState.Choices.STARTED.value and subtask.state.value == models.SubtaskState.Choices.RESTARTING.value:
subtask.state = models.SubtaskState.objects.get(value=models.SubtaskState.Choices.STARTING.value)
# handle reverse path to defined
elif desired_state_value == models.SubtaskState.Choices.DEFINED.value and subtask.state.value == models.SubtaskState.Choices.UNSCHEDULABLE.value:
subtask.state = models.SubtaskState.objects.get(value=models.SubtaskState.Choices.DEFINED.value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment