Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
536f313e
Commit
536f313e
authored
Sep 19, 2018
by
BAIRE Anthony
Browse files
redirect to JobDetail after job creation
parent
1279f3fc
Pipeline
#40392
failed with stage
in 1 minute and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
django/allgo/main/views.py
View file @
536f313e
...
...
@@ -743,9 +743,11 @@ class JobCreate(SuccessMessageMixin, CreateView):
model
=
Job
form_class
=
JobForm
success_message
=
'Job created successfully.'
success_url
=
reverse_lazy
(
'main:job_list'
)
template_name
=
'webapp_detail.html'
def
get_success_url
(
self
):
return
reverse
(
'main:job_detail'
,
args
=
(
self
.
job_id
,))
def
form_valid
(
self
,
form
):
"""Save data coming from the form in the database """
webapp
=
Webapp
.
objects
.
get
(
docker_name
=
self
.
kwargs
[
'docker_name'
])
...
...
@@ -772,6 +774,7 @@ class JobCreate(SuccessMessageMixin, CreateView):
# start the job
obj
.
state
=
Job
.
WAITING
obj
.
save
()
self
.
job_id
=
obj
.
id
return
super
().
form_valid
(
form
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment