Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
0533977d
Commit
0533977d
authored
Oct 02, 2017
by
Clinton Blackburn
Committed by
Clinton Blackburn
Oct 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabled publication of credit seats to from Publisher to E-Commerce
LEARNER-2721
parent
b59ca418
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
course_discovery/apps/publisher/api/v1/tests/test_views.py
+2
-0
course_discovery/apps/publisher/api/v1/views.py
+3
-2
No files found.
course_discovery/apps/publisher/api/v1/tests/test_views.py
View file @
0533977d
...
@@ -90,6 +90,8 @@ class CourseRunViewSetTests(APITestCase):
...
@@ -90,6 +90,8 @@ class CourseRunViewSetTests(APITestCase):
publisher_course_run
=
self
.
_create_course_run_for_publication
()
publisher_course_run
=
self
.
_create_course_run_for_publication
()
audit_seat
=
SeatFactory
(
course_run
=
publisher_course_run
,
type
=
Seat
.
AUDIT
,
upgrade_deadline
=
None
)
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
)
professional_seat
=
SeatFactory
(
course_run
=
publisher_course_run
,
type
=
Seat
.
PROFESSIONAL
)
verified_seat
=
SeatFactory
(
course_run
=
publisher_course_run
,
type
=
Seat
.
VERIFIED
)
verified_seat
=
SeatFactory
(
course_run
=
publisher_course_run
,
type
=
Seat
.
VERIFIED
)
...
...
course_discovery/apps/publisher/api/v1/views.py
View file @
0533977d
...
@@ -12,7 +12,7 @@ from course_discovery.apps.core.utils import serialize_datetime
...
@@ -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
CourseRun
as
DiscoveryCourseRun
from
course_discovery.apps.course_metadata.models
import
Course
,
Video
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.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
from
course_discovery.apps.publisher.studio_api_utils
import
StudioAPI
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -76,7 +76,8 @@ class CourseRunViewSet(viewsets.GenericViewSet):
...
@@ -76,7 +76,8 @@ class CourseRunViewSet(viewsets.GenericViewSet):
'verification_deadline'
:
serialize_datetime
(
course_run
.
end
),
'verification_deadline'
:
serialize_datetime
(
course_run
.
end
),
'create_or_activate_enrollment_code'
:
False
,
'create_or_activate_enrollment_code'
:
False
,
# NOTE (CCB): We only order here to aid testing. The E-Commerce API does NOT care about ordering.
# 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
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment