Commit 0533977d by Clinton Blackburn Committed by Clinton Blackburn

Disabled publication of credit seats to from Publisher to E-Commerce

LEARNER-2721
parent b59ca418
......@@ -90,6 +90,8 @@ class CourseRunViewSetTests(APITestCase):
publisher_course_run = self._create_course_run_for_publication()
audit_seat = SeatFactory(course_run=publisher_course_run, type=Seat.AUDIT, upgrade_deadline=None)
# The credit seat should NOT be published.
SeatFactory(course_run=publisher_course_run, type=Seat.CREDIT)
professional_seat = SeatFactory(course_run=publisher_course_run, type=Seat.PROFESSIONAL)
verified_seat = SeatFactory(course_run=publisher_course_run, type=Seat.VERIFIED)
......
......@@ -12,7 +12,7 @@ from course_discovery.apps.core.utils import serialize_datetime
from course_discovery.apps.course_metadata.models import CourseRun as DiscoveryCourseRun
from course_discovery.apps.course_metadata.models import Course, Video
from course_discovery.apps.publisher.api.utils import serialize_seat_for_ecommerce_api
from course_discovery.apps.publisher.models import CourseRun
from course_discovery.apps.publisher.models import CourseRun, Seat
from course_discovery.apps.publisher.studio_api_utils import StudioAPI
logger = logging.getLogger(__name__)
......@@ -76,7 +76,8 @@ class CourseRunViewSet(viewsets.GenericViewSet):
'verification_deadline': serialize_datetime(course_run.end),
'create_or_activate_enrollment_code': False,
# NOTE (CCB): We only order here to aid testing. The E-Commerce API does NOT care about ordering.
'products': [serialize_seat_for_ecommerce_api(seat) for seat in course_run.seats.all().order_by('created')],
'products': [serialize_seat_for_ecommerce_api(seat) for seat in
course_run.seats.exclude(type=Seat.CREDIT).order_by('created')],
}
try:
......
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