Skip to content
Snippets Groups Projects
Commit c7635321 authored by Theo Lesage's avatar Theo Lesage
Browse files

Proper validation for task restart based on Task.original_task

parent c32b9d34
No related branches found
No related tags found
No related merge requests found
......@@ -224,10 +224,8 @@ class TaskRestart(ProcessACLMixin, CreateAPIView):
detail="Task's state must be in a final state to be restarted."
)
# TODO Check the original_task_id field directly once it is implemented
# https://gitlab.teklia.com/arkindex/frontend/-/issues/1383
_, *suffix = task.slug.rsplit("_old", 1)
if suffix:
if len(Task.objects.filter(original_task=task)) > 0:
raise ValidationError(
detail="This task has already been restarted"
)
......
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