Skip to content

Commit

Permalink
Revert "feat: add course and program availability in APIs (#3094)" (#…
Browse files Browse the repository at this point in the history
…3096)

This reverts commit 4488976.
  • Loading branch information
arslanashraf7 committed Aug 8, 2024
1 parent 4488976 commit 8a0104b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
22 changes: 0 additions & 22 deletions courses/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ class CourseSerializer(serializers.ModelSerializer):
credits = serializers.SerializerMethodField()
platform = serializers.SerializerMethodField()
marketing_hubspot_form_id = serializers.SerializerMethodField()
availability = serializers.SerializerMethodField()

def get_availability(self, instance): # noqa: ARG002
"""Get course availability"""

# This is a hard coded value because the consumers of the API need this field.
# In an ideal situation the availability could be "dated" or "anytime".
# Since all the courses in xPRO are dated so we will not check for "self paced"
# courses to determine if the course could be "anytime"
return "dated"

def get_url(self, instance):
"""Get CMS Page URL for the course"""
Expand Down Expand Up @@ -227,7 +217,6 @@ class Meta:
"credits",
"is_external",
"platform",
"availability",
]


Expand Down Expand Up @@ -291,16 +280,6 @@ class ProgramSerializer(serializers.ModelSerializer):
video_url = serializers.SerializerMethodField()
credits = serializers.SerializerMethodField()
platform = serializers.SerializerMethodField()
availability = serializers.SerializerMethodField()

def get_availability(self, instance): # noqa: ARG002
"""Get program availability"""

# This is a hard coded value because the consumers of the API need this field.
# In an ideal situation the availability could be "dated" or "anytime".
# Since all the programs in xPRO are dated so we will not check for "self paced"
# courses to determine if the course could be "anytime"
return "dated"

def get_courses(self, instance):
"""Serializer for courses"""
Expand Down Expand Up @@ -432,7 +411,6 @@ class Meta:
"credits",
"is_external",
"platform",
"availability",
]


Expand Down
2 changes: 0 additions & 2 deletions courses/serializers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def test_serialize_program( # noqa: PLR0913
"external_marketing_url": external_marketing_url,
"marketing_hubspot_form_id": marketing_hubspot_form_id,
"platform": program.platform.name,
"availability": "dated",
},
)
assert data["end_date"] != non_live_run.end_date.strftime(datetime_format)
Expand Down Expand Up @@ -297,7 +296,6 @@ def test_serialize_course( # noqa: PLR0913
marketing_hubspot_form_id if course_page else None
),
"platform": course.platform.name,
"availability": "dated",
},
)

Expand Down

0 comments on commit 8a0104b

Please sign in to comment.