diff --git a/lms/djangoapps/badges/api/serializers.py b/lms/djangoapps/badges/api/serializers.py index 6af8e7a0c728..6dd8a30c366d 100644 --- a/lms/djangoapps/badges/api/serializers.py +++ b/lms/djangoapps/badges/api/serializers.py @@ -52,7 +52,7 @@ def get_profile_image_url(self, instance): str: The profile image URL. """ - return get_profile_image_urls_for_user(instance)['medium'] + return get_profile_image_urls_for_user(instance, self.context['request'])['medium'] class Meta: model = User diff --git a/lms/djangoapps/course_home_api/course_metadata/views.py b/lms/djangoapps/course_home_api/course_metadata/views.py index ee55ebd77380..f15b6bb7fb54 100644 --- a/lms/djangoapps/course_home_api/course_metadata/views.py +++ b/lms/djangoapps/course_home_api/course_metadata/views.py @@ -131,7 +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'], + 'profile_image_url': get_profile_image_urls_for_user(request.user, request)['medium'], } context = self.get_serializer_context() context['course'] = course