From 3ecbe5128e7201385a13c4dd939f4ec9226dc5fc Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 9 Oct 2023 21:35:05 +0200 Subject: [PATCH] Fix formulaire modif utilisateur (CAS allow login) --- app/views/users.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/users.py b/app/views/users.py index 6bf16f4dcd..3d07b05a3f 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -594,8 +594,14 @@ def create_user_form(user_name=None, edit=0, all_roles=True): roles = set(vals["roles"]).intersection(editable_roles_strings) if not current_user.is_administrator(): # empeche modification des paramètres CAS - vals.pop("cas_allow_login", None) - vals.pop("cas_allow_scodoc_login", None) + if "cas_allow_login" in vals: + vals["cas_allow_login"] = cas_allow_login_default + if "cas_allow_scodoc_login" in vals: + if the_user is None: + vals.pop("cas_allow_scodoc_login", None) + else: + vals["cas_allow_scodoc_login"] = the_user.cas_allow_scodoc_login + if not current_user.has_permission(Permission.UsersChangeCASId): vals.pop("cas_id", None) if "edit" in vals: