From 97a221aa243035928cb330c960ac608beedeef27 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Tue, 5 May 2020 19:41:45 -0400 Subject: [PATCH] Fix an issue where session id no longer exists --- CTFd/utils/initialization/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CTFd/utils/initialization/__init__.py b/CTFd/utils/initialization/__init__.py index 7304584..b92af1e 100644 --- a/CTFd/utils/initialization/__init__.py +++ b/CTFd/utils/initialization/__init__.py @@ -202,7 +202,8 @@ def init_request_processors(app): except (InvalidRequestError, IntegrityError): db.session.rollback() logout_user() - clear_user_recent_ips(user_id=session["id"]) + else: + clear_user_recent_ips(user_id=session["id"]) @app.before_request def banned():