send codeRivoli to back

This commit is contained in:
Johan Le Baut 2022-02-13 00:26:31 +01:00
parent bd24f9044c
commit 8c7ff6a11b
2 changed files with 6 additions and 3 deletions

View file

@ -111,6 +111,7 @@
// Global variables
var communes = []
var codeInsee = 0
var codeRivoli = ""
var voies = []
var voie = ""
@ -183,7 +184,7 @@
for (i in voies) {
voie = voies[i]
$("#voies").append("<option value='" +
voie[1] + "'>" + voie[0] + "</option>");
voie[0] + "'></option>");
if (voie[0] === search) {
valueMatch=true;
}
@ -191,6 +192,7 @@
if (voies.length == 1 || valueMatch) {
$('#btnTestAdresse').collapse('show');
voie = voies[0]
codeRivoli = voie[1]
$("#voieInput").val(voie[0]);
$('#btnTestAdresse').focus();
} else {
@ -257,6 +259,7 @@
$('#formAddressTest').submit(function(eventObj) {
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeInsee" value="${codeInsee}" />`);
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeRivoli" value="${codeRivoli}" />`);
return true;
});
});

View file

@ -57,8 +57,8 @@ def test_address():
codeInsee = escape(request.form['codeInsee'])
numeroVoie = escape(request.form['numeroVoie'])
# Trimming rivoli's key
voie = escape(request.form['voie'])[:-1]
result = query_axione_fantoir(cfg, codeInsee, voie, numeroVoie)
codeRivoli = escape(request.form['codeRivoli'])[:-1]
result = query_axione_fantoir(cfg, codeInsee, codeRivoli, numeroVoie)
return render_template("result.html", pto="", result=result)