From bc39997c064bce330a57840a7804220db7311583 Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet <emmanuel.viennet@gmail.com>
Date: Thu, 19 Dec 2024 13:47:54 +0100
Subject: [PATCH] =?UTF-8?q?Fix:=20edition=20user=20avec=20cas=5Fid=20num?=
 =?UTF-8?q?=C3=A9rique?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/scodoc/TrivialFormulator.py | 6 +++++-
 app/views/users.py              | 1 +
 sco_version.py                  | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py
index 8bc15bda..16ed3d78 100644
--- a/app/scodoc/TrivialFormulator.py
+++ b/app/scodoc/TrivialFormulator.py
@@ -264,7 +264,11 @@ class TF(object):
                         self.values[field] = ""
 
             # convert numbers, except ids
-            if field.endswith("id") and self.values[field]:
+            if (
+                field.endswith("id")
+                and not descr.get("no_convert")
+                and self.values[field]
+            ):
                 # enforce integer ids:
                 try:
                     self.values[field] = int(self.values[field])
diff --git a/app/views/users.py b/app/views/users.py
index 9857546b..c5525031 100644
--- a/app/views/users.py
+++ b/app/views/users.py
@@ -415,6 +415,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
             {
                 "title": "Identifiant CAS",
                 "input_type": "text",
+                "no_convert": True,  # empeche conversion en int de l'id
                 "explanation": "id du compte utilisateur sur le CAS de l'établissement "
                 + (
                     "<b>pa défaut identique à l'identifiant ScoDoc</b> "
diff --git a/sco_version.py b/sco_version.py
index 26b19232..241e74c8 100644
--- a/sco_version.py
+++ b/sco_version.py
@@ -3,7 +3,7 @@
 
 "Infos sur version ScoDoc"
 
-SCOVERSION = "9.7.48"
+SCOVERSION = "9.7.49"
 
 SCONAME = "ScoDoc"
 
-- 
GitLab