From 2d87e55bb117765d87f82cc0d5ec643484b70f1f Mon Sep 17 00:00:00 2001 From: Bart Date: Mon, 11 Sep 2023 13:58:54 +0200 Subject: [PATCH] Make status messages index configurable (#1362) --- app/signals/apps/search/documents/status_message.py | 4 +++- app/signals/settings/base.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/signals/apps/search/documents/status_message.py b/app/signals/apps/search/documents/status_message.py index 2b54a3085..6fbfd79d3 100644 --- a/app/signals/apps/search/documents/status_message.py +++ b/app/signals/apps/search/documents/status_message.py @@ -2,6 +2,8 @@ # Copyright (C) 2023 Gemeente Amsterdam from elasticsearch_dsl import Boolean, Document, Integer, Keyword, Text +from signals.apps.search.settings import app_settings + class StatusMessage(Document): id = Integer() @@ -11,4 +13,4 @@ class StatusMessage(Document): active = Boolean() class Index: - name = 'status_messages' + name = app_settings.CONNECTION['STATUS_MESSAGE_INDEX'] diff --git a/app/signals/settings/base.py b/app/signals/settings/base.py index 61f4b80e4..b6ff82b1a 100644 --- a/app/signals/settings/base.py +++ b/app/signals/settings/base.py @@ -372,6 +372,7 @@ def is_super_user(user): 'CONNECTION': { 'HOST': os.getenv('ELASTICSEARCH_HOST', 'elastic-index.service.consul:9200'), 'INDEX': os.getenv('ELASTICSEARCH_INDEX', 'signals'), + 'STATUS_MESSAGE_INDEX': os.getenv('ELASTICSEARCH_STATUS_MESSAGE_INDEX', 'status_messages'), }, }