Commit ddcbb3a0 by Damien Moulard

possible error cases

parent c72ad4c0
Pipeline #2320 passed with stage
in 1 minute 26 seconds
...@@ -751,8 +751,10 @@ def create_pair(request): ...@@ -751,8 +751,10 @@ def create_pair(request):
"partner_id": parent_id, "partner_id": parent_id,
"point_qty": -1}) "point_qty": -1})
try:
api.execute('res.partner', 'run_process_target_status', []) api.execute('res.partner', 'run_process_target_status', [])
except:
pass
m = CagetteMember(child_id).unsubscribe_member() m = CagetteMember(child_id).unsubscribe_member()
# update child base account state # update child base account state
......
...@@ -277,19 +277,20 @@ function create_pair(payload) { ...@@ -277,19 +277,20 @@ function create_pair(payload) {
}, },
error: function(data) { error: function(data) {
err = {msg: "erreur serveur", ctx: 'create pair'}; err = {msg: "erreur serveur", ctx: 'create pair'};
var message = 'Erreur lors de création du binôme.';
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.errors != 'undefined') { if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.errors != 'undefined') {
err.msg += ' : ' + data.responseJSON.errors; err.msg += ' : ' + data.responseJSON.errors;
}
report_JS_error(err, 'members.admin');
closeModal();
var message = 'Erreur lors de création du binôme.';
data.responseJSON.errors.map(function(error) { data.responseJSON.errors.map(function(error) {
message += ('\n' + error); message += ('\n' + error);
return null; return null;
}); });
}
report_JS_error(err, 'members.admin');
closeModal();
alert(message); alert(message);
} }
}); });
......
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