non succeeeded in ajax test
This commit is contained in:
@@ -38,6 +38,7 @@ from django.views.generic.edit import UpdateView,DeleteView
|
||||
|
||||
from django.http import (
|
||||
HttpResponse, HttpResponseRedirect,
|
||||
JsonResponse,
|
||||
HttpResponseForbidden, HttpResponseNotAllowed,
|
||||
HttpResponseNotFound,Http404
|
||||
)
|
||||
@@ -227,6 +228,7 @@ class JSONResponse(HttpResponse):
|
||||
kwargs['content_type'] = 'application/json'
|
||||
super(JSONResponse, self).__init__(content, **kwargs)
|
||||
|
||||
|
||||
def getrequestrower(request,rowerid=0,userid=0,notpermanent=False):
|
||||
|
||||
userid = int(userid)
|
||||
@@ -12038,7 +12040,10 @@ def workout_toggle_ranking(request,id=0):
|
||||
row.save()
|
||||
|
||||
if is_ajax:
|
||||
return JSONResponse({'result':row.rankingpiece})
|
||||
response = JSONResponse({'result':row.rankingpiece},
|
||||
content_type='application/json')
|
||||
|
||||
return response
|
||||
else:
|
||||
url = reverse(workouts_view)
|
||||
response = HttpResponseRedirect(url)
|
||||
|
||||
Reference in New Issue
Block a user