From 6478189020f5dda211542cfe2f01254612341f3a Mon Sep 17 00:00:00 2001 From: Muhammad Ali Date: Thu, 30 May 2024 21:14:58 +0500 Subject: [PATCH] fix --- .../management/commands/update_index.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/course_discovery/apps/edx_haystack_extensions/management/commands/update_index.py b/course_discovery/apps/edx_haystack_extensions/management/commands/update_index.py index 6a54004bf5..fe5ce09e3a 100644 --- a/course_discovery/apps/edx_haystack_extensions/management/commands/update_index.py +++ b/course_discovery/apps/edx_haystack_extensions/management/commands/update_index.py @@ -56,10 +56,12 @@ def handle(self, **options): record_count_is_sane, index_info_string = self.sanity_check_new_index( backend.conn, index, record_count ) - if record_count_is_sane: - indexes_pending.pop(index, None) - else: + if not record_count_is_sane: indexes_pending[index] = index_info_string + else: + indexes_pending.pop(index, None) + else: + indexes_pending.pop(index, None) if indexes_pending: raise CommandError(f'Sanity check failed for new index(es): {indexes_pending}')