From 68f3cbbb7e133f35c225debe8c6f9c6ca22b66d7 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Fri, 13 Nov 2020 19:51:12 +0100
Subject: [PATCH] Allow further configuration of django-cachalot

---
 aleksis/core/settings.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py
index fc6f93e3d..b03f78e62 100644
--- a/aleksis/core/settings.py
+++ b/aleksis/core/settings.py
@@ -206,8 +206,10 @@ if _settings.get("caching.memcached.enabled", False):
             "LOCATION": _settings.get("caching.memcached.address", "127.0.0.1:11211"),
         }
     }
-    INSTALLED_APPS.append("cachalot")
-    DEBUG_TOOLBAR_PANELS.append("cachalot.panels.CachalotPanel")
+    if _settings.get("caching.cachalot.enabled", True):
+        INSTALLED_APPS.append("cachalot")
+        DEBUG_TOOLBAR_PANELS.append("cachalot.panels.CachalotPanel")
+        CACHALOT_TIMEOUT = _settings.get("caching.cachalot.timeout", None)
 
 # Password validation
 # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
-- 
GitLab