Private
Public Access
1
0

test deregistrations

This commit is contained in:
Sander Roosendaal
2020-07-06 15:42:06 +02:00
parent 64b7ffa464
commit b6ffd00492
3 changed files with 24 additions and 1 deletions

View File

@@ -1024,7 +1024,22 @@ def garmin_summaries_view(request):
return HttpResponse(status=400)
@csrf_exempt
@csrf_exempt
def garmin_deregistration_view(request):
if request.method != 'POST':
raise Http404("not allowed")
data = json.loads(request.body)
garmintoken = data['userAccessToken']
try:
r = Rower.objects.get(garmintoken=garmintoken)
r.garmintoken = ''
except Rower.DoesNotExist:
raise HttpResponseNotFound("Not found")
return HttpResponse(status=200)
@csrf_exempt
def garmin_details_view(request):
if request.method != 'POST':
raise Http404("not allowed")