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
1d8613f3
Unverified
Commit
1d8613f3
authored
Nov 27, 2017
by
Matt Tuchfarber
Committed by
GitHub
Nov 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16602 from edx/tuchfarber/fix_instructor_ordering
Fix instructors ordering on program marketing page
parents
4a938c14
2c67f964
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
openedx/core/djangoapps/programs/utils.py
+7
-6
No files found.
openedx/core/djangoapps/programs/utils.py
View file @
1d8613f3
...
...
@@ -604,8 +604,8 @@ class ProgramMarketingDataExtender(ProgramDataExtender):
def
__init__
(
self
,
program_data
,
user
):
super
(
ProgramMarketingDataExtender
,
self
)
.
__init__
(
program_data
,
user
)
# Aggregate
dict of instructors for the program keyed by name
self
.
instructors
=
{}
# Aggregate
list of instructors for the program
self
.
instructors
=
[]
# Values for programs' price calculation.
self
.
data
[
'avg_price_per_course'
]
=
0.0
...
...
@@ -627,7 +627,7 @@ class ProgramMarketingDataExtender(ProgramDataExtender):
if
not
program_instructors
:
# We cache the program instructors list to avoid repeated modulestore queries
program_instructors
=
self
.
instructors
.
values
()
program_instructors
=
self
.
instructors
cache
.
set
(
cache_key
,
program_instructors
,
3600
)
self
.
data
[
'instructors'
]
=
program_instructors
...
...
@@ -687,6 +687,7 @@ class ProgramMarketingDataExtender(ProgramDataExtender):
course_instructors
=
getattr
(
course_descriptor
,
'instructor_info'
,
{})
# Deduplicate program instructors using instructor name
self
.
instructors
.
update
(
{
instructor
.
get
(
'name'
,
''
)
.
strip
():
instructor
for
instructor
in
course_instructors
.
get
(
'instructors'
,
[])}
)
curr_instructors_names
=
[
instructor
.
get
(
'name'
,
''
)
.
strip
()
for
instructor
in
self
.
instructors
]
for
instructor
in
course_instructors
.
get
(
'instructors'
,
[]):
if
instructor
.
get
(
'name'
,
''
)
.
strip
()
not
in
curr_instructors_names
:
self
.
instructors
.
append
(
instructor
)
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