Merge branch 'Aufinal/encode_trigramme' into 'k-fet'

K-Psul - Fix: Lien -> création/modification de comptes

Le javascript de K-Psul encode maintenant les caractères spéciaux (dont `, / ? : @ & = + $ # "`) afin de pouvoir avoir accès aux comptes en question sans bugs.

See merge request !131
This commit is contained in:
Aurélien Delobelle 2016-12-09 17:30:11 +01:00
commit e63e56371d

View file

@ -245,12 +245,14 @@ $(document).ready(function() {
if (account_data['id'] != 0) {
var url_base = '{% url 'kfet.account.read' 'LIQ' %}';
url_base = url_base.substr(0, url_base.length - 3);
buttons += '<a href="'+ url_base + account_data['trigramme']+'" class="btn btn-primary" target="_blank" title="Modifier"><span class="glyphicon glyphicon-cog"></span></a>';
trigramme = encodeURIComponent(account_data['trigramme']) ;
buttons += '<a href="'+ url_base + trigramme +'" class="btn btn-primary" target="_blank" title="Modifier"><span class="glyphicon glyphicon-cog"></span></a>';
}
if (account_data['id'] == 0) {
var trigramme = triInput.val().toUpperCase();
var url_base = '{% url 'kfet.account.create' %}'
if (isValidTrigramme(trigramme)) {
trigramme = encodeURIComponent(trigramme);
buttons += '<a href="'+url_base+'?trigramme='+trigramme+'" class="btn btn-primary" target="_blank" title="Créer"><span class="glyphicon glyphicon-plus"></span></a>';
}
}