From db8b92f7ed93ae3312936ccf30d24b0b2c7f3a8c Mon Sep 17 00:00:00 2001 From: Evarin Date: Fri, 6 Oct 2017 10:29:00 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9vention=20des=20doublons=20de=20lieux?= =?UTF-8?q?=20de=20stage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/avisstage/formulaires/stage.html | 8 ++++++++ avisstage/templatetags/avisstage_tags.py | 6 ++++-- avisstage/views.py | 13 ++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/avisstage/templates/avisstage/formulaires/stage.html b/avisstage/templates/avisstage/formulaires/stage.html index 7daf964..e63735c 100644 --- a/avisstage/templates/avisstage/formulaires/stage.html +++ b/avisstage/templates/avisstage/formulaires/stage.html @@ -117,6 +117,14 @@ console.log(lieu); console.log(lieu_focus); if(lieu_focus === undefined) { + // Élimination des doublons + var candidates = $("input.lieu-hidden"); + for (var i=0; i