Commit d943b10a authored by raida's avatar raida

Send form to server

parent dfd4ad15
......@@ -1713,6 +1713,19 @@ def WEI1Aalgo(request, sock, kwargs):
request.session["quest"] += separator + request.POST.get("reponse")
variables["liste"] = algo1a.test(True, request.session["quest"].split("#"), request.session["wei1A2019"]["nom"] + request.session["wei1A2019"]["prenom"])
if variables["liste"] is None: # Fin du questionnaire
request.session["wei1A2019"]["quest"] = variables["quest"]
sock.write(json.dumps(["wei_compute_form", ["1a", request.session["wei1A2019"], ], ]))
out = nk.full_read(sock)
if out["retcode"] != 0:
messages.add_error(request, out["errmsg"])
variables["succes"] = False
return (variables, "note/wei_succes.html")
else:
variables["succes"] = True
return (variables, "note/wei_succes.html")
else:
messages.add_error(request, "Requête inattendue : {}".format(request.method))
return HttpResponseRedirect("{}wei/1a/".format(settings.NOTE_ROOT_URL))
......
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