From 9714a7d5d103fa548512d16931350705c8c1622d Mon Sep 17 00:00:00 2001 From: Christopher Pettinga Date: Wed, 30 Oct 2024 15:39:57 +0000 Subject: [PATCH] ECIL-209 - Access Request - Link to Exporter Typeahead search not working --- config/settings.py | 12 ++++++++++-- pii-ner-exclude.txt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/settings.py b/config/settings.py index d5032b4f3..9feb9813b 100644 --- a/config/settings.py +++ b/config/settings.py @@ -293,10 +293,18 @@ CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": REDIS_URL, + "LOCATION": REDIS_URL + "/0", "OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient"}, }, "django_compressor_cache": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}, + # Using a separate cache for select2 to avoid conflicts with other caches, this is the recommended approach + "select2": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": REDIS_URL + "/2", + "OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient"}, + # 1 hour timeout to avoid accidental expiry leading to failed AJAX requests + "TIMEOUT": 60 * 60 * 1, + }, } SESSION_ENGINE = "django.contrib.sessions.backends.cache" @@ -309,7 +317,7 @@ SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True -SELECT2_CACHE_BACKEND = "default" +SELECT2_CACHE_BACKEND = "select2" SELECT2_CSS = os.path.join(STATIC_URL, "3rdparty/select2/select2.min.css") SELECT2_JS = os.path.join(STATIC_URL, "3rdparty/select2/select2.min.js") diff --git a/pii-ner-exclude.txt b/pii-ner-exclude.txt index c0d8a2cf2..ce3f50481 100644 --- a/pii-ner-exclude.txt +++ b/pii-ner-exclude.txt @@ -5080,3 +5080,4 @@ Email Attachments Missing Constabulary Email Attachments Internal Server Error Response Details +AJAX