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

Fix linting, missing argument in restart test and old things in api

parent bfd7ff7b
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.
......@@ -235,7 +235,6 @@ class TaskRestart(ProcessACLMixin, CreateAPIView):
parents = list(copy.parents.all())
# Rename the original task
basename, *_ = copy.slug.rsplit("_old", 1)
if copy.original_task_id:
basename, *_ = copy.slug.rsplit("_old", 1)
else:
......
......@@ -332,7 +332,6 @@ class Task(models.Model):
null=True,
blank=True,
)
original_task = models.ForeignKey(
"self",
on_delete=models.SET_NULL,
......
......@@ -635,6 +635,7 @@ class TestAPI(FixtureAPITestCase):
mock_now.return_value = datetime.now(timezone.utc) + timedelta(minutes=1)
old_task_2 = self.process.tasks.create(run=self.task1.run, depth=1, slug=f"{task_2_slug}_old1")
old_task_2.state = State.Error.value
old_task_2.original_task_id = self.task1.id
old_task_2.save()
old_task_2.parents.add(self.task1)
self.task1.state = State.Completed.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