Skip to content

Commit

Permalink
Revert "feat: added transcript_languages_search_facet_names to Course…
Browse files Browse the repository at this point in the history
…RunSeria…" (#4301)

This reverts commit 8949716.
  • Loading branch information
DawoudSheraz authored Mar 26, 2024
1 parent 8949716 commit a331207
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
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

0 comments on commit a331207

Please sign in to comment.