Commit 6f7cd37b authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

fix bug in post request

parent 5a9bcbbd
......@@ -19,8 +19,8 @@ class JobListView(ListView):
self.service.update_jobs_status()
j = Job.objects.all().order_by('-create_time')
if request.is_ajax():
action = request.GET.get('action')
job_id = request.GET.get('id')
action = request.POST.get('action')
job_id = request.POST.get('id')
print("FOOOOOOO", action, job_id)
return self._logic(action, job_id)
jobs = {
......@@ -35,6 +35,7 @@ class JobListView(ListView):
if request.is_ajax():
action = request.POST.get('action')
job_id = request.POST.get('id')
print(request.POST)
return self._logic(action, job_id)
return HttpResponseRedirect(reverse('job_list'))
......
......@@ -194,10 +194,9 @@
// ------------------------------
sendData: function(data, success, error) {
$.ajax({
method: "GET",
method: "POST",
url: AJAX_URL,
cache: false,
contentType: "application/json; charset=utf-8",
headers: { 'X-CSRFToken': $.cookie('csrftoken') },
data: data,
success: success,
......
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