Skip to content

Commit

Permalink
Merge pull request #458 from edly-io/alisalman/update-metadata-view
Browse files Browse the repository at this point in the history
update: add profile_image_url in metadata view
  • Loading branch information
Ali-Salman29 authored Nov 28, 2023
2 parents 6a2793f + 7d776a1 commit b6e0eaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ class CourseHomeMetadataSerializer(VerifiedModeSerializer):
username = serializers.CharField()
user_timezone = serializers.CharField()
can_view_certificate = serializers.BooleanField()
profile_image_url = serializers.CharField()
2 changes: 2 additions & 0 deletions lms/djangoapps/course_home_api/course_metadata/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from lms.djangoapps.certificates.api import certificates_viewable_for_course
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.djangoapps.courseware_api.utils import get_celebrations_dict
from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_urls_for_user

from common.djangoapps.student.models import CourseEnrollment
from lms.djangoapps.course_api.api import course_detail
Expand Down Expand Up @@ -130,6 +131,7 @@ def get(self, request, *args, **kwargs):
'celebrations': celebrations,
'user_timezone': user_timezone,
'can_view_certificate': certificates_viewable_for_course(course),
'profile_image_url': get_profile_image_urls_for_user(request.user)['medium'],
}
context = self.get_serializer_context()
context['course'] = course
Expand Down

0 comments on commit b6e0eaa

Please sign in to comment.