From 5894c6f952f8b330720f6b28edd5de341e8057fd Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet <emmanuel.viennet@gmail.com>
Date: Fri, 24 May 2024 15:37:07 +0200
Subject: [PATCH] search_etud_by_name: case insensitive.

---
 app/scodoc/sco_find_etud.py | 4 ++--
 app/static/js/scodoc.js     | 6 ------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/app/scodoc/sco_find_etud.py b/app/scodoc/sco_find_etud.py
index 87686cfb..45c15dd4 100644
--- a/app/scodoc/sco_find_etud.py
+++ b/app/scodoc/sco_find_etud.py
@@ -301,7 +301,7 @@ def search_etud_by_name(term: str) -> list:
                 FROM identite
                 WHERE
                 dept_id = %(dept_id)s
-                AND code_nip LIKE %(beginning)s
+                AND code_nip ILIKE %(beginning)s
                 ORDER BY nom
                 """,
                 {"beginning": term + "%", "dept_id": g.scodoc_dept_id},
@@ -320,7 +320,7 @@ def search_etud_by_name(term: str) -> list:
                 FROM identite
                 WHERE
                 dept_id = %(dept_id)s
-                AND nom LIKE %(beginning)s
+                AND nom ILIKE %(beginning)s
                 ORDER BY nom
                 """,
                 {"beginning": term + "%", "dept_id": g.scodoc_dept_id},
diff --git a/app/static/js/scodoc.js b/app/static/js/scodoc.js
index 32de3734..8bcc47c4 100644
--- a/app/static/js/scodoc.js
+++ b/app/static/js/scodoc.js
@@ -185,7 +185,6 @@ $(function () {
       if (x) {
         try {
           let order_info = JSON.parse(x);
-          console.log("set order=" + order_info);
           table_options.order = order_info;
         } catch (error) {
           console.error(error);
@@ -248,11 +247,6 @@ class ScoFieldEditor {
       return true; // Aucune modification, pas d'enregistrement mais on continue normalement
     }
     obj.classList.add("sco_wait");
-    // DEBUG
-    // console.log(`
-    //     data : ${value},
-    //     id: ${obj.dataset.oid}
-    // `);
 
     $.post(
       this.save_url,
-- 
GitLab