From c78bab5ac2f28633459b9fd8c50e80be5899be01 Mon Sep 17 00:00:00 2001 From: Kevin Meinhardt Date: Tue, 5 Nov 2024 15:49:49 +0100 Subject: [PATCH] Also wipe when recreating alias from existing index --- src/olympia/amo/management/commands/initialize.py | 2 +- src/olympia/amo/tests/test_commands.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/olympia/amo/management/commands/initialize.py b/src/olympia/amo/management/commands/initialize.py index 420a010d779..e3da0542c14 100644 --- a/src/olympia/amo/management/commands/initialize.py +++ b/src/olympia/amo/management/commands/initialize.py @@ -58,4 +58,4 @@ def handle(self, *args, **options): # We should reindex even if no data is loaded/modified # because we might have a fresh instance of elasticsearch else: - call_command('reindex', '--noinput', '--skip-if-exists') + call_command('reindex', '--wipe', '--noinput', '--skip-if-exists') diff --git a/src/olympia/amo/tests/test_commands.py b/src/olympia/amo/tests/test_commands.py index 6452947566b..8c10124a621 100644 --- a/src/olympia/amo/tests/test_commands.py +++ b/src/olympia/amo/tests/test_commands.py @@ -345,7 +345,9 @@ class Commands: flush = mock.call('flush', '--noinput') reindex_force_wipe = mock.call('reindex', '--wipe', '--force', '--noinput') - reindex_skip_if_exists = mock.call('reindex', '--noinput', '--skip-if-exists') + reindex_skip_if_exists = mock.call( + 'reindex', '--wipe', '--noinput', '--skip-if-exists' + ) load_initial_data = mock.call('loaddata', 'initial.json') import_prod_versions = mock.call('import_prod_versions') createsuperuser = mock.call(