diff --git a/learning_resources/serializers.py b/learning_resources/serializers.py index 7424951892..e04e3fc7c7 100644 --- a/learning_resources/serializers.py +++ b/learning_resources/serializers.py @@ -21,7 +21,6 @@ LevelType, Pace, ) -from learning_resources.etl.loaders import update_index from main.serializers import COMMON_IGNORED_FIELDS, WriteableSerializerMethodField log = logging.getLogger(__name__) @@ -592,7 +591,6 @@ def create(self, validated_data): models.LearningPath.objects.create( learning_resource=path_resource, author=request.user ) - update_index(path_resource, True) # noqa: FBT003 return path_resource def update(self, instance, validated_data): @@ -604,7 +602,6 @@ def update(self, instance, validated_data): resource.topics.set( models.LearningResourceTopic.objects.filter(id__in=topics_data) ) - update_index(resource, False) # noqa: FBT003 return resource class Meta: diff --git a/learning_resources/views.py b/learning_resources/views.py index 3eee185926..47b165059b 100644 --- a/learning_resources/views.py +++ b/learning_resources/views.py @@ -83,7 +83,6 @@ ) from learning_resources.tasks import get_ocw_courses from learning_resources.utils import ( - resource_delete_actions, resource_unpublished_actions, ) from learning_resources_search.api import get_similar_resources @@ -384,9 +383,6 @@ def get_queryset(self): queryset = queryset.filter(published=True) return queryset - def perform_destroy(self, instance): - resource_delete_actions(instance) - @extend_schema_view( list=extend_schema( diff --git a/learning_resources/views_learningpath_test.py b/learning_resources/views_learningpath_test.py index 51709bad99..f3214fdd43 100644 --- a/learning_resources/views_learningpath_test.py +++ b/learning_resources/views_learningpath_test.py @@ -105,7 +105,6 @@ def test_learning_path_endpoint_get(client, user, is_public, is_editor, has_imag @pytest.mark.parametrize("is_editor", [True, False]) @pytest.mark.parametrize("is_anonymous", [True, False]) def test_learning_path_endpoint_create( # pylint: disable=too-many-arguments # noqa: PLR0913 - mock_opensearch, client, is_anonymous, is_published, @@ -134,17 +133,12 @@ def test_learning_path_endpoint_create( # pylint: disable=too-many-arguments # if resp.status_code == 201: assert resp.data.get("title") == resp.data.get("title") assert resp.data.get("description") == resp.data.get("description") - assert mock_opensearch.upsert_si.call_count == ( - 1 if has_permission and is_published else 0 - ) @pytest.mark.parametrize("is_public", [True, False]) @pytest.mark.parametrize("is_editor", [True, False]) @pytest.mark.parametrize("update_topics", [True, False]) -def test_learning_path_endpoint_patch( - mock_opensearch, client, update_topics, is_public, is_editor -): +def test_learning_path_endpoint_patch(client, update_topics, is_public, is_editor): """Test learningpath endpoint for updating a LearningPath""" [original_topic, new_topic] = factories.LearningResourceTopicFactory.create_batch(2) user = UserFactory.create() @@ -179,8 +173,6 @@ def test_learning_path_endpoint_patch( assert resp.data["topics"][0]["id"] == ( new_topic.id if update_topics else original_topic.id ) - assert mock_opensearch.upsert.call_count == (1 if is_public else 0) - assert mock_opensearch.deindex.call_count == (1 if not is_public else 0) @pytest.mark.parametrize("is_editor", [True, False]) @@ -343,7 +335,7 @@ def test_learning_path_items_endpoint_delete_items(client, user, is_editor, num_ @pytest.mark.parametrize("is_editor", [True, False]) -def test_learning_path_endpoint_delete(mock_opensearch, client, user, is_editor): +def test_learning_path_endpoint_delete(client, user, is_editor): """Test learningpath endpoint for deleting a LearningPath""" learning_path = factories.LearningPathFactory.create() @@ -366,7 +358,6 @@ def test_learning_path_endpoint_delete(mock_opensearch, client, user, is_editor) ).exists() is not is_editor ) - assert mock_opensearch.deindex.call_count == (1 if is_editor else 0) @pytest.mark.parametrize("is_editor", [True, False]) diff --git a/learning_resources_search/api_test.py b/learning_resources_search/api_test.py index 068e89595b..de332979af 100644 --- a/learning_resources_search/api_test.py +++ b/learning_resources_search/api_test.py @@ -54,7 +54,6 @@ def os_topic(topic_name) -> Mock: "testindex_program_default", "testindex_podcast_default", "testindex_podcast_episode_default", - "testindex_learning_path_default", "testindex_video_default", "testindex_video_playlist_default", ], diff --git a/learning_resources_search/connection_test.py b/learning_resources_search/connection_test.py index 8522385344..de28b16560 100644 --- a/learning_resources_search/connection_test.py +++ b/learning_resources_search/connection_test.py @@ -50,8 +50,6 @@ def test_get_active_aliases(mocker, index_types, indexes_exist, object_types): "testindex_podcast_reindexing", "testindex_podcast_episode_default", "testindex_podcast_episode_reindexing", - "testindex_learning_path_default", - "testindex_learning_path_reindexing", "testindex_video_default", "testindex_video_reindexing", "testindex_video_playlist_default", @@ -64,7 +62,6 @@ def test_get_active_aliases(mocker, index_types, indexes_exist, object_types): "testindex_program_default", "testindex_podcast_default", "testindex_podcast_episode_default", - "testindex_learning_path_default", "testindex_video_default", "testindex_video_playlist_default", ] @@ -75,7 +72,6 @@ def test_get_active_aliases(mocker, index_types, indexes_exist, object_types): "testindex_program_reindexing", "testindex_podcast_reindexing", "testindex_podcast_episode_reindexing", - "testindex_learning_path_reindexing", "testindex_video_reindexing", "testindex_video_playlist_reindexing", ] diff --git a/learning_resources_search/constants.py b/learning_resources_search/constants.py index 796c48f5ea..2bdcc1b952 100644 --- a/learning_resources_search/constants.py +++ b/learning_resources_search/constants.py @@ -40,7 +40,6 @@ class IndexestoUpdate(Enum): PROGRAM_TYPE, PODCAST_TYPE, PODCAST_EPISODE_TYPE, - LEARNING_PATH_TYPE, VIDEO_TYPE, VIDEO_PLAYLIST_TYPE, )