From 6603d4f3811a2f45e48d16cb1c114e14228f712a Mon Sep 17 00:00:00 2001 From: anfbermudezme Date: Fri, 3 Nov 2023 18:17:47 +0100 Subject: [PATCH] fix: obtain course images from image_url. --- ecommerce/courses/utils.py | 4 +--- ecommerce/extensions/api/v2/views/vouchers.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ecommerce/courses/utils.py b/ecommerce/courses/utils.py index bcd7544b892..49f45491373 100644 --- a/ecommerce/courses/utils.py +++ b/ecommerce/courses/utils.py @@ -4,12 +4,10 @@ from django.conf import settings from django.utils.translation import ugettext_lazy as _ +from ecommerce.core.utils import deprecated_traverse_pagination, get_cache_key from edx_django_utils.cache import TieredCache from opaque_keys.edx.keys import CourseKey -from ecommerce.core.utils import deprecated_traverse_pagination, get_cache_key - - LMS_COURSES_API_BASE_URL = '/api/courses/v1/courses/' diff --git a/ecommerce/extensions/api/v2/views/vouchers.py b/ecommerce/extensions/api/v2/views/vouchers.py index c13afdd861e..3033c234c05 100644 --- a/ecommerce/extensions/api/v2/views/vouchers.py +++ b/ecommerce/extensions/api/v2/views/vouchers.py @@ -339,7 +339,7 @@ def get_course_offer_data( image = course_info['card_image_url'] else: # Get the course image from the LMS course API format. - image = course_info.get('media', {}).get('image', {}).get('raw', '') + image = course_info.get('image_url', '') return { 'benefit': serializers.BenefitSerializer(benefit).data, 'contains_verified': is_verified,