From 72dfcc086d368cee501460bcca6e6040f5b46e07 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 12 May 2023 12:59:23 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20#631:=20cas=5Fid=20num=C3=A9rique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/auth/cas.py | 2 +- app/scodoc/sco_users.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/auth/cas.py b/app/auth/cas.py index 4aac61b1..b9584f83 100644 --- a/app/auth/cas.py +++ b/app/auth/cas.py @@ -30,7 +30,7 @@ def after_cas_login(): flask.session.get("CAS_USERNAME"), ) if cas_id is not None: - user: User = User.query.filter_by(cas_id=cas_id).first() + user: User = User.query.filter_by(cas_id=str(cas_id)).first() if user and user.active: if user.cas_allow_login: current_app.logger.info(f"CAS: login {user.user_name}") diff --git a/app/scodoc/sco_users.py b/app/scodoc/sco_users.py index 7a4f21d5..72168b83 100644 --- a/app/scodoc/sco_users.py +++ b/app/scodoc/sco_users.py @@ -351,7 +351,7 @@ def check_modif_user( # Unicité du cas_id if cas_id: - cas_users = User.query.filter_by(cas_id=cas_id).all() + cas_users = User.query.filter_by(cas_id=str(cas_id)).all() if edit: if cas_users and ( len(cas_users) > 1 or cas_users[0].user_name != user_name