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
8dc7e656
Commit
8dc7e656
authored
May 31, 2017
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed course-run send for review if seat type is credit.
LEARNER-1250
parent
1fece291
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
course_discovery/apps/publisher/models.py
+2
-2
course_discovery/apps/publisher/tests/test_model.py
+9
-0
No files found.
course_discovery/apps/publisher/models.py
View file @
8dc7e656
...
...
@@ -329,7 +329,7 @@ class CourseRun(TimeStampedModel, ChangedByMixin):
"""
Validate course-run has a valid seats.
"""
seats
=
self
.
seats
.
filter
(
type__in
=
[
Seat
.
AUDIT
,
Seat
.
VERIFIED
,
Seat
.
PROFESSIONAL
])
seats
=
self
.
seats
.
filter
(
type__in
=
[
Seat
.
AUDIT
,
Seat
.
VERIFIED
,
Seat
.
PROFESSIONAL
,
Seat
.
CREDIT
])
return
all
([
seat
.
is_valid_seat
for
seat
in
seats
])
if
seats
else
False
...
...
@@ -379,7 +379,7 @@ class Seat(TimeStampedModel, ChangedByMixin):
return
(
self
.
type
==
self
.
AUDIT
or
(
self
.
type
in
[
self
.
VERIFIED
,
self
.
PROFESSIONAL
]
and
self
.
price
>
0
)
or
(
self
.
type
==
self
.
CREDIT
and
self
.
credit_price
>
0
)
(
self
.
type
==
self
.
CREDIT
and
self
.
credit_price
>
0
and
self
.
price
>
0
)
)
...
...
course_discovery/apps/publisher/tests/test_model.py
View file @
8dc7e656
...
...
@@ -123,6 +123,15 @@ class CourseRunTests(TestCase):
self
.
assertTrue
(
self
.
course_run
.
has_valid_seats
)
credit_seat
=
factories
.
SeatFactory
(
course_run
=
self
.
course_run
,
type
=
Seat
.
CREDIT
,
price
=
0
,
credit_price
=
0
)
self
.
assertFalse
(
self
.
course_run
.
has_valid_seats
)
credit_seat
.
price
=
200
credit_seat
.
credit_price
=
200
credit_seat
.
save
()
self
.
assertTrue
(
self
.
course_run
.
has_valid_seats
)
class
CourseTests
(
TestCase
):
""" Tests for the publisher `Course` model. """
...
...
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