diff --git a/peachjam/migrations/0132_outcome_es_index.py b/peachjam/migrations/0132_outcome_es_index.py index 9063eb24d..96c15eedf 100644 --- a/peachjam/migrations/0132_outcome_es_index.py +++ b/peachjam/migrations/0132_outcome_es_index.py @@ -9,23 +9,23 @@ def forwards(apps, schema_editor): from django.conf import settings from django_elasticsearch_dsl.registries import registry - # if not settings.DEBUG and os.environ.get("ELASTICSEARCH_HOST"): - for ix in registry.get_indices(): - if not ix._mapping: - continue - print(f"Adding outcome mapping for {ix._name}") - ix.connection.indices.put_mapping( - index=ix._name, - body={ - "properties": { - "outcome": ix._mapping["outcome"].to_dict(), - "outcome_en": ix._mapping["outcome_en"].to_dict(), - "outcome_sw": ix._mapping["outcome_sw"].to_dict(), - "outcome_fr": ix._mapping["outcome_fr"].to_dict(), - "outcome_pt": ix._mapping["outcome_pt"].to_dict(), - } - }, - ) + if not settings.DEBUG and os.environ.get("ELASTICSEARCH_HOST"): + for ix in registry.get_indices(): + if not ix._mapping: + continue + print(f"Adding outcome mapping for {ix._name}") + ix.connection.indices.put_mapping( + index=ix._name, + body={ + "properties": { + "outcome": ix._mapping["outcome"].to_dict(), + "outcome_en": ix._mapping["outcome_en"].to_dict(), + "outcome_sw": ix._mapping["outcome_sw"].to_dict(), + "outcome_fr": ix._mapping["outcome_fr"].to_dict(), + "outcome_pt": ix._mapping["outcome_pt"].to_dict(), + } + }, + ) class Migration(migrations.Migration):