Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Merge requests
!2304
Link tasks to their restarts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Link tasks to their restarts
fk-task-restart
into
master
Overview
11
Commits
10
Pipelines
0
Changes
1
Merged
Theo Lesage
requested to merge
fk-task-restart
into
master
11 months ago
Overview
4
Commits
10
Pipelines
0
Changes
1
Expand
Closes
#1711 (closed)
0
0
Merge request reports
Viewing commit
bfd7ff7b
Prev
Next
Show latest version
1 file
+
4
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bfd7ff7b
Fix interity error on old task
· bfd7ff7b
Theo Lesage
authored
11 months ago
arkindex/ponos/api.py
+
4
−
0
Options
@@ -236,6 +236,10 @@ class TaskRestart(ProcessACLMixin, CreateAPIView):
# Rename the original task
basename
,
*
_
=
copy
.
slug
.
rsplit
(
"
_old
"
,
1
)
if
copy
.
original_task_id
:
basename
,
*
_
=
copy
.
slug
.
rsplit
(
"
_old
"
,
1
)
else
:
basename
=
copy
.
slug
latest_task
=
Task
.
objects
.
filter
(
run
=
copy
.
run
,
slug__startswith
=
f
"
{
basename
}
_old
"
).
order_by
(
"
-created
"
).
first
()
if
not
latest_task
:
# There is no previously restarted task: the original task will have the slug slug_old1
Loading