Skip to content

Commit

Permalink
Make status messages index configurable (#1362)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartjkdp authored Sep 11, 2023
1 parent 137f223 commit 2d87e55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/signals/apps/search/documents/status_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -11,4 +13,4 @@ class StatusMessage(Document):
active = Boolean()

class Index:
name = 'status_messages'
name = app_settings.CONNECTION['STATUS_MESSAGE_INDEX']
1 change: 1 addition & 0 deletions app/signals/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
},
}

Expand Down

0 comments on commit 2d87e55

Please sign in to comment.