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
fab31da2
Commit
fab31da2
authored
Sep 24, 2018
by
BERJON Matthieu
Browse files
Merge branch 'ui-redirect-jobdetail-on-jobcreate' into 'django'
redirect to JobDetail after job creation See merge request
!130
parents
60943222
536f313e
Pipeline
#40708
failed with stage
in 1 minute and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
django/allgo/main/views.py
View file @
fab31da2
...
...
@@ -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