Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: add profile_image_url in metadata view #458

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading