Private
Public Access
1
0

non succeeeded in ajax test

This commit is contained in:
Sander Roosendaal
2019-01-03 18:11:19 +01:00
parent 8ff24d3fae
commit abceefa42c
7 changed files with 101 additions and 2977 deletions

View File

@@ -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)