From 388992961aeea64e482dbb1a851c0bfc7aaea0e3 Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet <emmanuel.viennet@gmail.com>
Date: Mon, 13 Jan 2025 13:43:05 +0100
Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20creation=20user=20si=20CAS=20non?=
 =?UTF-8?q?=20activ=C3=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/auth/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/auth/models.py b/app/auth/models.py
index a3a0c3e47..1fd96ff9f 100644
--- a/app/auth/models.py
+++ b/app/auth/models.py
@@ -416,7 +416,7 @@ class User(UserMixin, ScoDocModel):
             args, excluded={"cas_id", "user_name", "roles_string", "roles"}
         )
 
-        new_cas_id = args.get("cas_id")
+        new_cas_id = args.get("cas_id", "").strip() or None
         if ScoDocSiteConfig.cas_uid_use_scodoc():
             new_cas_id = self.user_name
         else: