Skip to content

Commit

Permalink
Merge branch 'master' into rpenido/fal-3621-paste-tags-when-pasting-x…
Browse files Browse the repository at this point in the history
…blocks-with-tag-data
  • Loading branch information
rpenido authored Feb 29, 2024
2 parents dacba7d + ea55eca commit 24c4729
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
9 changes: 9 additions & 0 deletions lms/djangoapps/course_home_api/course_metadata/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def get_url(self, tab):
return request.build_absolute_uri(tab.link_func(self.context.get('course'), reverse))


class CourseModeSerrializer(serializers.Serializer):
"""
Serializer for the Course Mode
"""
slug = serializers.CharField()
name = serializers.CharField()


class CourseHomeMetadataSerializer(VerifiedModeSerializer):
"""
Serializer for the Course Home Course Metadata
Expand All @@ -48,3 +56,4 @@ class CourseHomeMetadataSerializer(VerifiedModeSerializer):
username = serializers.CharField()
user_timezone = serializers.CharField()
can_view_certificate = serializers.BooleanField()
course_modes = CourseModeSerrializer(many=True)
4 changes: 4 additions & 0 deletions lms/djangoapps/course_home_api/course_metadata/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.djangoapps.courseware_api.utils import get_celebrations_dict

from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.student.models import CourseEnrollment
from lms.djangoapps.course_api.api import course_detail
from lms.djangoapps.course_goals.models import UserActivity
Expand Down Expand Up @@ -117,6 +118,8 @@ def get(self, request, *args, **kwargs):
# Record course goals user activity for (web) learning mfe course tabs
UserActivity.record_user_activity(request.user, course_key)

course_modes = CourseMode.modes_for_course(course_key, include_expired=True, only_selectable=False)

data = {
'course_id': course.id,
'username': username,
Expand All @@ -133,6 +136,7 @@ def get(self, request, *args, **kwargs):
'celebrations': celebrations,
'user_timezone': user_timezone,
'can_view_certificate': certificates_viewable_for_course(course),
'course_modes': course_modes,
}
context = self.get_serializer_context()
context['course'] = course
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ click>=8.0,<9.0
# The team that owns this package will manually bump this package rather than having it pulled in automatically.
# This is to allow them to better control its deployment and to do it in a process that works better
# for them.
edx-enterprise==4.12.6
edx-enterprise==4.13.0

# Stay on LTS version, remove once this is added to common constraint
Django<5.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ edx-drf-extensions==10.2.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.12.6
edx-enterprise==4.13.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ edx-drf-extensions==10.2.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.12.6
edx-enterprise==4.13.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ edx-drf-extensions==10.2.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.12.6
edx-enterprise==4.13.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ edx-drf-extensions==10.2.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.12.6
edx-enterprise==4.13.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down

0 comments on commit 24c4729

Please sign in to comment.