fix url account neg K-Psul

This commit is contained in:
Aurélien Delobelle 2016-09-06 18:50:57 +02:00
parent 6ba8c9e741
commit ad661cab09

View file

@ -66,8 +66,11 @@ function getErrorsHtml(data) {
content += '</ul>';
}
if ('negative' in data['errors']) {
var url_base = "{% url 'kfet.account.update' LIQ}";
url_base = url_base.substr(0, url_base.length - 8);
if (window.location.pathname.startsWith('/gestion/')) {
var url_base = '/gestion/k-fet/accounts/';
} else {
var url_base = '/k-fet/accounts/';
}
for (var i=0; i<data['errors']['negative'].length; i++) {
content += '<a class="btn btn-primary" href="'+url_base+data['errors']['negative'][i]+'/edit" target="_blank" style="width:100%">Autorisation de négatif requise pour '+data['errors']['negative'][i]+'</a>';
}