Skip to content
Snippets Groups Projects
Commit f1bdd75f authored by Mario Raciti's avatar Mario Raciti
Browse files

TMSS-1123: Add state transitions from 'unschedulable' to 'cancelled' and 'error'

parent e635800c
No related branches found
No related tags found
2 merge requests!634WIP: COBALT commissioning delta,!625Resolve TMSS-1123
......@@ -160,6 +160,8 @@ def populate_subtask_allowed_state_transitions(apps, schema_editor):
SubtaskAllowedStateTransitions(old_state=SCHEDULING, new_state=SCHEDULED),
SubtaskAllowedStateTransitions(old_state=SCHEDULING, new_state=UNSCHEDULABLE),
SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=DEFINED),
SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=CANCELLED),
SubtaskAllowedStateTransitions(old_state=UNSCHEDULABLE, new_state=ERROR),
SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=STARTING), # this is an odd one, as most (all?) subtasks are queued before execution...
SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=QUEUEING),
SubtaskAllowedStateTransitions(old_state=SCHEDULED, new_state=UNSCHEDULING),
......
......@@ -109,6 +109,7 @@ def set_subtask_state_following_allowed_transitions(subtask: typing.Union[Subtas
SubtaskState.Choices.QUEUEING.value,
SubtaskState.Choices.STARTING.value,
SubtaskState.Choices.FINISHING.value,
SubtaskState.Choices.UNSCHEDULABLE.value,
SubtaskState.Choices.CANCELLING.value):
subtask.state = SubtaskState.objects.get(value=SubtaskState.Choices.ERROR.value)
subtask.error_reason = 'set_subtask_state_following_allowed_transitions'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment