1
0
forked from ScoDoc/ScoDoc

Fix #631: cas_id numérique

This commit is contained in:
Emmanuel Viennet 2023-05-12 12:59:23 +02:00
parent 45a950ad79
commit 866efbed92
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ def after_cas_login():
flask.session.get("CAS_USERNAME"), flask.session.get("CAS_USERNAME"),
) )
if cas_id is not None: 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 and user.active:
if user.cas_allow_login: if user.cas_allow_login:
current_app.logger.info(f"CAS: login {user.user_name}") current_app.logger.info(f"CAS: login {user.user_name}")

View File

@ -351,7 +351,7 @@ def check_modif_user(
# Unicité du cas_id # Unicité du cas_id
if 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 edit:
if cas_users and ( if cas_users and (
len(cas_users) > 1 or cas_users[0].user_name != user_name len(cas_users) > 1 or cas_users[0].user_name != user_name