-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ability to include unlisted courses in catalogs #767
Conversation
e1e75c5
to
a025c53
Compare
a025c53
to
2f22378
Compare
courses.extend(discovery_client.get_courses(query_params=query_params)) | ||
|
||
return courses | ||
return DiscoveryApiClient().fetch_courses_by_keys(course_keys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this logic into the client, left the old signature to maintain tests
programs.extend(discovery_client.get_programs(query_params=query_params)) | ||
|
||
return programs | ||
return DiscoveryApiClient().fetch_programs_by_keys(program_keys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this logic into the client, left the old signature to maintain tests
@@ -394,6 +376,10 @@ def _update_full_content_metadata_course(content_keys): | |||
metadata_record.json_metadata['reviews_count'] = review.get('reviews_count') | |||
metadata_record.json_metadata['avg_course_rating'] = review.get('avg_course_rating') | |||
|
|||
# johnnagro ENT-8212 need to retransform after full pull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we initially force-include the content, we need to mark it somehow so that the "full content metadata update job" knows to re-transform it on the full content metadata object it retrieves after the initial catalog crawl
@@ -326,6 +346,48 @@ def get_programs(self, query_params=None): | |||
|
|||
return programs | |||
|
|||
def fetch_courses_by_keys(self, course_keys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from tasks.py
|
||
return courses | ||
|
||
def fetch_programs_by_keys(self, program_keys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from tasks.py
@@ -102,6 +102,8 @@ | |||
'Certificación Profesional': 'Certificación Profesional', | |||
} | |||
|
|||
FORCE_INCLUSION_METADATA_TAG_KEY = 'enterprise_force_included' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic field which marks content metadata as having been force-included
@@ -394,6 +376,10 @@ def _update_full_content_metadata_course(content_keys): | |||
metadata_record.json_metadata['reviews_count'] = review.get('reviews_count') | |||
metadata_record.json_metadata['avg_course_rating'] = review.get('avg_course_rating') | |||
|
|||
# johnnagro ENT-8212 need to retransform after full pull | |||
if metadata_record.json_metadata.get(FORCE_INCLUSION_METADATA_TAG_KEY): | |||
metadata_record.json_metadata = transform_course_metadata_to_visible(metadata_record.json_metadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably do want to add/update a test to cover this line.
Description
enterprise_force_include_aggregation_keys
Todo