From 777d9453787ca665eefdc769959c6a4f343a7c87 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 23 Oct 2013 08:31:24 +0300 Subject: [PATCH] more robust autologout for weird situations --- unfold/loginrequired.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unfold/loginrequired.py b/unfold/loginrequired.py index 0f46ff79..ebe33d51 100644 --- a/unfold/loginrequired.py +++ b/unfold/loginrequired.py @@ -32,7 +32,9 @@ def logout_on_manifold_exception (fun_that_returns_httpresponse): except ManifoldException, manifold_result: # xxx we need a means to display this message to user... from django.contrib.auth import logout - logout(request) + # in some unusual cases, this might fail + try: logout(request) + except: pass return HttpResponseRedirect ('/') except Exception, e: # xxx we need to sugarcoat this error message in some error template... -- 2.43.0