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
Commits
d270bb0b
Commit
d270bb0b
authored
11 months ago
by
Theo Lesage
Browse files
Options
Downloads
Patches
Plain Diff
Proper validation for task restart based on Task.original_task
parent
73671d91
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/ponos/api.py
+1
-3
1 addition, 3 deletions
arkindex/ponos/api.py
with
1 addition
and
3 deletions
arkindex/ponos/api.py
+
1
−
3
View file @
d270bb0b
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment