diff --git a/enterprise_catalog/apps/api/v2/tests/test_views.py b/enterprise_catalog/apps/api/v2/tests/test_views.py index a5f412c1..d6ef6dba 100644 --- a/enterprise_catalog/apps/api/v2/tests/test_views.py +++ b/enterprise_catalog/apps/api/v2/tests/test_views.py @@ -188,7 +188,7 @@ def test_get_content_metadata_content_filters( 'key': 'course-v1:edX+course+run1', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, ], @@ -207,14 +207,14 @@ def test_get_content_metadata_content_filters( 'key': 'course-v1:edX+course+run1', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, { 'key': 'course-v1:edX+course+run2', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, ], @@ -405,7 +405,7 @@ def test_get_content_metadata_with_no_restriction_type( 'key': 'course-v1:edX+course+run1', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, ], @@ -424,14 +424,14 @@ def test_get_content_metadata_with_no_restriction_type( 'key': 'course-v1:edX+course+run1', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, { 'key': 'course-v1:edX+course+run2', 'status': 'published', 'is_enrollable': True, - 'is_marketable': False, + 'is_marketable': True, COURSE_RUN_RESTRICTION_TYPE_KEY: RESTRICTION_FOR_B2B, }, ], diff --git a/enterprise_catalog/apps/api/v2/views/enterprise_catalog_get_content_metadata.py b/enterprise_catalog/apps/api/v2/views/enterprise_catalog_get_content_metadata.py index 5803ca99..d71b1434 100644 --- a/enterprise_catalog/apps/api/v2/views/enterprise_catalog_get_content_metadata.py +++ b/enterprise_catalog/apps/api/v2/views/enterprise_catalog_get_content_metadata.py @@ -3,7 +3,6 @@ from enterprise_catalog.apps.api.v1.views.enterprise_catalog_get_content_metadata import ( EnterpriseCatalogGetContentMetadata, ) -from enterprise_catalog.apps.api.v2.utils import is_any_course_run_active logger = logging.getLogger(__name__) @@ -27,21 +26,3 @@ def get_queryset(self, **kwargs): ) return queryset.order_by('catalog_queries') - - def is_active(self, item): - """ - Determines if a content item is active. - Args: - item (ContentMetadata): The content metadata item to check. - Returns: - bool: True if the item is active, False otherwise. - For courses, checks if any course run is active. - For other content types, always returns True. - """ - if item.content_type == 'course': - active = is_any_course_run_active( - item.json_metadata.get('course_runs', [])) - if not active: - logger.debug(f'[get_content_metadata]: Content item {item.content_key} is not active.') - return active - return True