Fix special chars in trigramme

This commit is contained in:
Ludovic Stephan 2020-01-16 23:20:18 +01:00
parent ff968b68b2
commit 4d3531c2cb
2 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ var Account = Backbone.Model.extend({
},
url: function () {
return django_urls["kfet.account.read.json"](this.get("trigramme"))
return django_urls["kfet.account.read.json"](encodeURIComponent(this.get("trigramme")))
},
reset: function () {
@ -81,7 +81,7 @@ var AccountView = Backbone.View.extend({
get_buttons: function () {
var buttons = '';
if (this.model.id != 0) {
var url = django_urls["kfet.account.read"](this.model.get("trigramme"))
var url = django_urls["kfet.account.read"](encodeURIComponent(this.model.get("trigramme")))
buttons += `<a href="${url}" class="btn btn-primary" target="_blank" title="Modifier"><span class="glyphicon glyphicon-cog"></span></a>`;
} else {
var trigramme = this.$(this.input).val().toUpperCase();

View file

@ -56,7 +56,7 @@ $(document).ready(function () {
function getAccountData(trigramme, callback = function() {}) {
$.ajax({
dataType: "json",
url : django_urls["kfet.account.read.json"]({trigramme: trigramme}),
url : django_urls["kfet.account.read.json"]({trigramme: encodeURIComponent(trigramme)}),
method : "GET",
success : callback,
});