From 50efadf42138c1108f0ac181b9203084ff198656 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 27 Feb 2023 23:06:11 +0100 Subject: [PATCH] Fix logout logging --- app/auth/routes.py | 4 +++- sco_version.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/auth/routes.py b/app/auth/routes.py index b6a0df9a..5c984828 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -56,7 +56,9 @@ def login(): @bp.route("/logout") def logout() -> flask.Response: "Logout a scodoc user. If CAS session, logout from CAS. Redirect." - current_app.logger.info(f"logout user {current_user.user_name}") + if current_user: + user_name = getattr(current_user, "user_name", "anonymous") + current_app.logger.info(f"logout user {user_name}") logout_user() if ScoDocSiteConfig.is_cas_enabled() and flask.session.get("scodoc_cas_login_date"): flask.session.pop("scodoc_cas_login_date", None) diff --git a/sco_version.py b/sco_version.py index 17cdecb7..53ca1787 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.54" +SCOVERSION = "9.4.55" SCONAME = "ScoDoc"