Commit 352bf33d authored by Vincent Le gallic's avatar Vincent Le gallic

Gestion propre de l'erreur pour le cas des consos.

parent 686d9e6b
......@@ -1708,7 +1708,7 @@ def do_conso(request):
if success:
sock = sock_ou_response
sock.write(json.dumps(["consos", consodata]))
out = full_read(sock)["msg"]
out = full_read(sock)
return HttpResponse(json.dumps(out))
else:
return HttpResponse(u'"Erreur"')
......
......@@ -310,6 +310,11 @@ function do_conso_many_boutons(idbde, matching_term) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
var answer = JSON.parse(xhr.responseText);
if (!isSuccessCode(answer["retcode"])) {
display_error(answer["errmsg"]);
return;
}
answer = answer["msg"];
//On enlève du stack_button les consos qui ont marché et si il y a eu des échecs on alerte
var errorhappened = false;
var errlist = [];
......@@ -356,6 +361,11 @@ function do_conso_many_notes(idbut, labelbut) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
var answer = JSON.parse(xhr.responseText);
if (!isSuccessCode(answer["retcode"])) {
display_error(answer["errmsg"]);
return;
}
answer = answer["msg"];
//On enlève du stack les consos qui ont marché et si il y a eu des échecs on alerte
var errorhappened = false;
var errlist = [];
......@@ -420,6 +430,11 @@ function do_conso_multiples() {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
var answer = JSON.parse(xhr.responseText);
if (!isSuccessCode(answer["retcode"])) {
display_error(answer["errmsg"]);
return;
}
answer = answer["msg"];
//Si il y a eu des échecs on alerte
var errorhappened = false;
var errlist = [];
......
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