Commit e2ed75c2 by Michael Frey Committed by GitHub

Merge pull request #916 from edx/mjfrey/check-null-attr

Check for top level image null
parents 890b9102 72386e07
...@@ -191,7 +191,7 @@ class VoucherViewSet(NonDestroyableModelViewSet): ...@@ -191,7 +191,7 @@ class VoucherViewSet(NonDestroyableModelViewSet):
'contains_verified': is_verified, 'contains_verified': is_verified,
'course_start_date': course_info['start'], 'course_start_date': course_info['start'],
'id': course.id, 'id': course.id,
'image_url': course_info['image'].get('src', ''), 'image_url': course_info.get('image', '').get('src', ''),
'organization': CourseKey.from_string(course.id).org, 'organization': CourseKey.from_string(course.id).org,
'seat_type': course.type, 'seat_type': course.type,
'stockrecords': serializers.StockRecordSerializer(stock_record).data, 'stockrecords': serializers.StockRecordSerializer(stock_record).data,
......
...@@ -108,7 +108,7 @@ class BasketSummaryView(BasketView): ...@@ -108,7 +108,7 @@ class BasketSummaryView(BasketView):
try: try:
course = get_course_info_from_catalog(self.request.site, course_key) course = get_course_info_from_catalog(self.request.site, course_key)
description = course['short_description'] description = course['short_description']
image_url = course['image'].get('src', ''), image_url = course.get('image', '').get('src', '')
short_description = description if description else '' short_description = description if description else ''
course_name = course['title'] course_name = course['title']
except (ConnectionError, SlumberBaseException, Timeout): except (ConnectionError, SlumberBaseException, Timeout):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment