Commit 536f313e authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

redirect to JobDetail after job creation

parent 1279f3fc
Pipeline #40392 failed with stage
in 1 minute and 31 seconds
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment