Commit 23b694e5 authored by raida's avatar raida

Fix an other bug

parent 9d6f1739
......@@ -1655,7 +1655,7 @@ def WEI1A(request, sock, kwargs):
request.session["wei1A2019"]["infos"] = form.cleaned_data["infos"]
request.session["wei1A2019"]["soge"] = 't' if form.cleaned_data["soge"] else 'f'
request.session["wei1A2019"]["etranger"] = 't' if form.cleaned_data["etranger"] else 'f'
request.session["nb_quest"] = 0;
request.session["nb_quest"] = 0
if out["retcode"] != 0:
messages.add_error(request, out["errmsg"])
......@@ -1665,6 +1665,7 @@ def WEI1A(request, sock, kwargs):
variables["succes"] = True
variables["liste"] = algo1a.test(True, [], request.session["wei1A2019"]["nom"] + request.session["wei1A2019"]["prenom"])
variables["wei"] = request.session["wei1A2019"]
variables["nb_quest"] = 0
return (variables, "note/page_form.html")
else:
......@@ -1710,13 +1711,15 @@ def WEI1Aalgo(request, sock, kwargs):
variables["form"] = forms.WEI1AForm(label_suffix=_(u" :"))
variables["type"] = '1a'
variables["liste"] = algo1a.test(True, [], request.session["wei1A2019"]["nom"] + request.session["wei1A2019"]["prenom"])
variables["nb_quest"] = 0
request.session["nb_quest"] = 0
elif request.method == "POST":
separator = "#" if request.session["quest"] != "" else ""
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"])
request.session["nb_quest"] = (request.session["nb_quest"] / 100 * 20 + 1) / 20 * 100
request.session["nb_quest"] += 1
variables["nb_quest"] = request.session / 20 * 100
if variables["liste"] is None: # Fin du questionnaire
request.session["wei1A2019"]["quest"] = request.session["quest"]
......
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