Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
724168d6
Commit
724168d6
authored
Oct 05, 2017
by
Albert St. Aubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplification pr changes
parent
a4cb374b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
openedx/core/djangoapps/programs/utils.py
+8
-16
No files found.
openedx/core/djangoapps/programs/utils.py
View file @
724168d6
...
...
@@ -460,7 +460,7 @@ class ProgramDataExtender(object):
)
is_paid_seat
=
False
if
enrollment_mode
is
not
None
and
active
is
not
None
:
if
enrollment_mode
is
not
None
and
active
is
not
None
and
active
is
True
:
# Check all the applicable seat types
# this will also check for no-id-professional as professional
is_paid_seat
=
any
(
seat_type
in
enrollment_mode
for
seat_type
in
applicable_seat_types
)
...
...
@@ -478,25 +478,17 @@ class ProgramDataExtender(object):
bundle_variant
=
'full'
if
is_learner_eligible_for_one_click_purchase
:
for
course
in
self
.
data
[
'courses'
]:
add_course_sku
=
Fals
e
unpublished_enrollment
=
False
unpublished_course_runs
=
filter
(
lambda
run
:
run
[
'status'
]
==
'unpublished'
,
course
[
'course_runs'
]
)
published_course_runs
=
filter
(
lambda
run
:
run
[
'status'
]
==
'published'
,
course
[
'course_runs'
])
add_course_sku
=
Tru
e
course_runs
=
course
.
get
(
'course_runs'
,
[])
published_course_runs
=
filter
(
lambda
run
:
run
[
'status'
]
==
'published'
,
course_runs
)
if
len
(
published_course_runs
)
==
1
:
for
course_run
in
unpublished_
course_runs
:
for
course_run
in
course_runs
:
is_paid_seat
=
self
.
_check_enrollment_for_user
(
course_run
)
if
is_paid_seat
:
unpublished_enrollment
=
True
if
not
unpublished_enrollment
:
course_run
=
published_course_runs
[
0
]
is_paid_seat
=
self
.
_check_enrollment_for_user
(
course_run
)
if
not
is_paid_seat
:
add_course_sku
=
True
else
:
# There is no enrollment information for the course add the course SKU
add_course_sku
=
True
add_course_sku
=
False
break
if
add_course_sku
:
for
seat
in
published_course_runs
[
0
][
'seats'
]:
...
...
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