Skip to content

Commit

Permalink
Merge pull request #908 from openedx/revert-905-pwnage101/ENT-9209
Browse files Browse the repository at this point in the history
Revert "feat: support restricted/custom-b2b runs via enterprise_force_include_aggregation_keys"
  • Loading branch information
pwnage101 authored Aug 13, 2024
2 parents 882034f + edab4ed commit 5f70068
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions enterprise_catalog/apps/api_client/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

LOGGER = logging.getLogger(__name__)

CUSTOM_B2B_RESTRICTION_TYPE_KEY = 'custom-b2b-enterprise'


class DiscoveryApiClient(BaseOAuthClient):
"""
Expand Down Expand Up @@ -296,8 +294,7 @@ def get_metadata_by_query(self, catalog_query):
raise exc

try:
# NOTE johnnagro: This ONLY supports courses at the moment (NOT programs, leanerpathways, etc).
# NOTE Troy: This now also supports force-including restricted/custom-b2b courses.
# NOTE johnnagro this ONLY supports courses at the moment (NOT programs, leanerpathways, etc)
if forced_aggregation_keys := catalog_query.content_filter.get('enterprise_force_include_aggregation_keys'):
LOGGER.info(
'get_metadata_by_query enterprise_force_include_aggregation_keys seen'
Expand Down Expand Up @@ -327,7 +324,7 @@ def _retrieve_courses(self, offset, request_params):

def get_courses(self, query_params=None):
"""
Return results from the discovery service's /api/v1/courses/ endpoint.
Return results from the discovery service's /courses endpoint.
Arguments:
query_params (dict): additional query params for the rest api endpoint
Expand All @@ -339,11 +336,6 @@ def get_courses(self, query_params=None):
request_params = {
'ordering': 'key',
'limit': DISCOVERY_OFFSET_SIZE,
# ALWAYS include restricted/custom-b2b courses in the search results. Usability/visiblility of restricted
# courses is ultimately controlled at the level of catalog inclusion, but this helper function is designed
# to facilitate fetching specific courses. Therefore, there's no reason to hide anything restricted at this
# level of the code.
'include_restricted': CUSTOM_B2B_RESTRICTION_TYPE_KEY,
}
request_params.update(query_params or {})

Expand Down

0 comments on commit 5f70068

Please sign in to comment.