Skip to content
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

Revert "ENT-8400: Added transcript_languages_search_facet_names to CourseRunSerializer" #4301

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions course_discovery/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,6 @@ class CourseRunSerializer(MinimalCourseRunSerializer):
required=False, many=True, slug_field='code',
queryset=LanguageTag.objects.prefetch_related('translations').order_by('name')
)
transcript_languages_search_facet_names = serializers.SerializerMethodField()
video = VideoSerializer(required=False, allow_null=True, source='get_video')
instructors = serializers.SerializerMethodField(help_text='This field is deprecated. Use staff.')
staff = SlugRelatedFieldWithReadSerializer(slug_field='uuid', required=False, many=True,
Expand Down Expand Up @@ -1067,11 +1066,10 @@ class Meta(MinimalCourseRunSerializer.Meta):
'level_type', 'mobile_available', 'hidden', 'reporting_type', 'eligible_for_financial_aid',
'first_enrollable_paid_seat_price', 'has_ofac_restrictions', 'ofac_comment',
'enrollment_count', 'recent_enrollment_count', 'expected_program_type', 'expected_program_name',
'course_uuid', 'estimated_hours', 'content_language_search_facet_name', 'enterprise_subscription_inclusion',
'transcript_languages_search_facet_names'
'course_uuid', 'estimated_hours', 'content_language_search_facet_name', 'enterprise_subscription_inclusion'
)
read_only_fields = ('enrollment_count', 'recent_enrollment_count', 'content_language_search_facet_name',
'enterprise_subscription_inclusion', 'transcript_languages_search_facet_names')
'enterprise_subscription_inclusion')

def get_instructors(self, obj): # pylint: disable=unused-argument
# This field is deprecated. Use the staff field.
Expand All @@ -1086,17 +1084,6 @@ def get_content_language_search_facet_name(self, obj):
return None
return language.get_search_facet_display(translate=True)

def get_transcript_languages_search_facet_names(self, obj):
transcript_languages = obj.transcript_languages.all()
if not transcript_languages:
return None

transcript_languages_facet_names = []
for language in transcript_languages:
transcript_languages_facet_names.append(language.get_search_facet_display(translate=True))

return transcript_languages_facet_names

def update_video(self, instance, video_data):
# A separate video object is a historical concept. These days, we really just use the link address. So
# we look up a foreign key just based on the link and don't bother trying to match or set any other fields.
Expand Down
1 change: 0 additions & 1 deletion course_discovery/apps/api/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ def get_expected_data(cls, course_run, request):
'ofac_comment': course_run.ofac_comment,
'estimated_hours': get_course_run_estimated_hours(course_run),
'enterprise_subscription_inclusion': course_run.enterprise_subscription_inclusion,
'transcript_languages_search_facet_names': None
})
return expected

Expand Down
Loading