From 7b5c1f0d97b14a596dc50ea29f3cf61bafa7fd47 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Mon, 23 Dec 2024 13:41:25 +0100 Subject: [PATCH] # Hotfix * fixes bug where anonymous user trying to logout would throw error --- konova/views/logout.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/konova/views/logout.py b/konova/views/logout.py index 57a34fd6..abeb9b3e 100644 --- a/konova/views/logout.py +++ b/konova/views/logout.py @@ -25,9 +25,12 @@ class LogoutView(View): A redirect """ user = request.user - oauth_token = user.oauth_token - if oauth_token: - oauth_token.revoke() + try: + oauth_token = user.oauth_token + if oauth_token: + oauth_token.revoke() + except AttributeError: + pass logout(request) return redirect(SSO_SERVER_BASE)