Skip to content

Commit

Permalink
Revert "feat: Add new fields for wordpress filters EDLY-6765"
Browse files Browse the repository at this point in the history
  • Loading branch information
mfarhan943 authored May 21, 2024
1 parent 24f0081 commit 46acb3c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 111 deletions.
9 changes: 1 addition & 8 deletions course_discovery/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,7 @@ class Meta(MinimalCourseRunSerializer.Meta):
'enrollment_count', 'recent_enrollment_count', 'expected_program_type', 'expected_program_name',
'course_uuid', 'estimated_hours', 'invite_only', 'subjects',
'is_marketing_price_set', 'marketing_price_value', 'is_marketing_price_hidden', 'featured', 'card_image_url',
'average_rating', 'total_raters', 'yt_video_url', 'course_duration_override', 'course_training_packages',
'course_department', 'course_certifications', 'course_format', 'course_difficulty_level', 'course_language',
'average_rating', 'total_raters', 'yt_video_url', 'course_duration_override'
)
read_only_fields = ('enrollment_count', 'recent_enrollment_count',)

Expand Down Expand Up @@ -2273,12 +2272,6 @@ class Meta:
'total_raters',
'yt_video_url',
'course_duration_override',
'course_language',
'course_training_packages',
'course_department',
'course_certifications',
'course_format',
'course_difficulty_level',
)


Expand Down
6 changes: 0 additions & 6 deletions course_discovery/apps/api/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,6 @@ def get_expected_data(cls, course_run, request):
'marketing_price_value': course_run.marketing_price_value,
'yt_video_url': course_run.yt_video_url,
'course_duration_override': course_run.course_duration_override,
'course_training_packages': course_run.course_training_packages,
'course_department': course_run.course_department,
'course_certifications': course_run.course_certifications,
'course_format': course_run.course_format,
'course_difficulty_level': course_run.course_difficulty_level,
'course_language' : course_run.course_language,
'is_marketing_price_hidden': course_run.is_marketing_price_hidden,
'card_image_url': course_run.card_image_url,
'subjects': [],
Expand Down
6 changes: 0 additions & 6 deletions course_discovery/apps/course_metadata/data_loaders/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,12 +1079,6 @@ def _process_response(self, response):
course_run.is_marketing_price_hidden = body['hide_price']
course_run.yt_video_url = body['yt_video_url']
course_run.course_duration_override = body['course_duration_override']
course_run.course_training_packages = body['course_training_packages']
course_run.course_department = body['course_department']
course_run.course_certifications = body['course_certifications']
course_run.course_format = body['course_format']
course_run.course_difficulty_level = body['course_difficulty_level']
course_run.course_language = body['course_language']
course_run.status = self._process_course_status(body['status'])

course_run.tags.clear()
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions course_discovery/apps/course_metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,18 +1327,6 @@ class CourseRun(DraftModelMixin, CachedMixin, TimeStampedModel):
null=True, blank=True, help_text=_('This field contains override course duration value.'),
verbose_name=_('Course Duration Override')
)
course_training_packages = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Training Packages'))
course_department = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Department'))
course_certifications = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Certifications'))
course_format = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Format'))
course_difficulty_level = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Difficulty Level'))
course_language = models.CharField(
max_length=255, null=True, blank=True, verbose_name=_('Course Language'))

STATUS_CHANGE_EXEMPT_FIELDS = [
'start',
Expand Down
6 changes: 0 additions & 6 deletions course_discovery/apps/course_metadata/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ class CourseRunIndex(BaseCourseIndex, indexes.Indexable):
total_raters = indexes.IntegerField(model_attr='total_raters', null=True)
yt_video_url = indexes.CharField(model_attr='yt_video_url', null=True)
course_duration_override = indexes.IntegerField(model_attr='course_duration_override', null=True)
course_training_packages = indexes.CharField(model_attr='course_training_packages', null=True)
course_department = indexes.CharField(model_attr='course_department', null=True)
course_certifications = indexes.CharField(model_attr='course_certifications', null=True)
course_format = indexes.CharField(model_attr='course_format', null=True)
course_difficulty_level = indexes.CharField(model_attr='course_difficulty_level', null=True)
course_language = indexes.CharField(model_attr='course_language', null=True)

def read_queryset(self, using=None):
# Pre-fetch all fields required by the CourseRunSearchSerializer. Unfortunately, there's
Expand Down

0 comments on commit 46acb3c

Please sign in to comment.