Skip to content
Snippets Groups Projects
Commit 7ed5c383 authored by Theo Lesage's avatar Theo Lesage Committed by Bastien Abadie
Browse files

Better restart validation test

parent 6531e5c2
No related branches found
No related tags found
1 merge request!2304Link tasks to their restarts
This commit is part of merge request !2304. Comments created here will be created in the context of that merge request.
......@@ -223,7 +223,7 @@ class TaskRestart(ProcessACLMixin, CreateAPIView):
raise ValidationError(
detail="Task's state must be in a final state to be restarted."
)
if len(Task.objects.filter(original_task=task)) > 0:
if task.restarts.exists():
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