Répare le traitement des petits cours

Les fonctions de traitement des demandes faisaient des cast étranges à
l'aide de `base64`. Ça devrait être lié à python2 je suppose.
This commit is contained in:
Martin Pépin 2016-12-23 09:37:54 +01:00
parent 6e5c3c8c33
commit dc32ae6ad2

View file

@ -146,9 +146,7 @@ def _finalize_traitement(request, demande, proposals, proposed_for,
"proposed_for": proposed_for, "proposed_for": proposed_for,
"proposed_mails": proposed_mails, "proposed_mails": proposed_mails,
"mainmail": mainmail, "mainmail": mainmail,
"attribdata": "attribdata": json.dumps(attribdata),
base64.b64encode(json.dumps(attribdata)
.encode('utf_8')),
"redo": redo, "redo": redo,
"errors": errors, "errors": errors,
}) })
@ -258,7 +256,7 @@ def _traitement_post(request, demande):
extra = request.POST["extra"].strip() extra = request.POST["extra"].strip()
redo = "redo" in request.POST redo = "redo" in request.POST
attribdata = request.POST["attribdata"] attribdata = request.POST["attribdata"]
attribdata = dict(json.loads(base64.b64decode(attribdata))) attribdata = dict(json.loads(attribdata))
for matiere in demande.matieres.all(): for matiere in demande.matieres.all():
if matiere.id not in attribdata: if matiere.id not in attribdata:
unsatisfied.append(matiere) unsatisfied.append(matiere)