From 18e2118fc8bf74eed04b01b33b86269d758799a4 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 30 Nov 2018 15:54:13 -0800 Subject: [PATCH] Revert "sessions: Stop using the cached_db sessions engine." This reverts commit 2fa77d9d543a4eaa7c97250816543909965da747. Further investigation has determined that this did not fix the password-reset problem described in the previous commit message; meanwhile, it causes other problems. We still need to track down the root cause of the original password-reset bug. --- zerver/lib/sessions.py | 2 +- zproject/settings.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/zerver/lib/sessions.py b/zerver/lib/sessions.py index 665bb129d3..d2c5552d41 100644 --- a/zerver/lib/sessions.py +++ b/zerver/lib/sessions.py @@ -49,7 +49,7 @@ def delete_all_deactivated_user_sessions() -> None: for session in Session.objects.all(): user_profile_id = get_session_user(session) if user_profile_id is None: - continue # nocoverage # to debug + continue user_profile = get_user_profile_by_id(user_profile_id) if not user_profile.is_active or user_profile.realm.deactivated: logging.info("Deactivating session for deactivated user %s" % (user_profile.email,)) diff --git a/zproject/settings.py b/zproject/settings.py index 1768360d95..82765af4b2 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -650,9 +650,7 @@ RABBITMQ_PASSWORD = get_secret("rabbitmq_password") # CACHING CONFIGURATION ######################################################################## -# TODO: Restore this to django.contrib.sessions.backends.cached_db -# after debugging; see https://github.com/zulip/zulip/issues/10856 for details. -SESSION_ENGINE = "django.contrib.sessions.backends.db" +SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" # Compress large values being stored in memcached; this is important # for at least the realm_users cache.