From 46cd9a6c2e6055333702f377292e21b995719f62 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 5 Apr 2022 18:08:33 +0200 Subject: [PATCH] step adder work in progress --- rowers/views/planviews.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rowers/views/planviews.py b/rowers/views/planviews.py index 8a6cfc91..72236892 100644 --- a/rowers/views/planviews.py +++ b/rowers/views/planviews.py @@ -2974,8 +2974,6 @@ def stepadder(request, id=0): ) ps = get_object_or_404(PlannedSession, pk=id) - print(request.method,'aap') - if request.method != 'POST': message = {'status': 'false', 'message': 'this view cannot be accessed through GET'} @@ -2996,7 +2994,17 @@ def stepadder(request, id=0): 'message': 'permission denied for host '+hostt[0]} return JSONResponse(status=403, data=message) - print(post_data) + steps = { + "filename": "", + } + for id in post_data: + try: + step = PlannedSessionStep.objects.get(id=int(id)) + print(step.name) + # add JSON + except PlannedSessionStep.DoesNotExist: + print('fail') + pass return JSONResponse(status=200,data=post_data)