Skip to content
Snippets Groups Projects

Link tasks to their restarts

Merged Theo Lesage requested to merge fk-task-restart into master
All threads resolved!
1 file
+ 1
3
Compare changes
  • Side-by-side
  • Inline
+ 1
3
@@ -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"
)
Loading