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
0770b7f1
Commit
0770b7f1
authored
Jan 17, 2016
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make searching for reused keys more efficient.
parent
3d167093
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
common/lib/xmodule/xmodule/modulestore/mixed.py
+8
-4
No files found.
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
0770b7f1
...
@@ -324,11 +324,15 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
...
@@ -324,11 +324,15 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
This key may represent a course that doesn't exist in this modulestore.
This key may represent a course that doesn't exist in this modulestore.
"""
"""
possible_keys
=
[
store
.
make_course_key
(
org
,
course
,
run
)
for
store
in
self
.
modulestores
]
# If there is a mapping that match this org/course/run, use that
# If there is a mapping that match this org/course/run, use that
for
course_id
,
store
in
self
.
mappings
.
iteritems
():
for
key
in
possible_keys
:
candidate_key
=
store
.
make_course_key
(
org
,
course
,
run
)
if
key
in
self
.
mappings
:
if
candidate_key
==
course_id
:
return
self
.
mappings
[
key
]
return
candidate_key
# Otherwise, return the key created by the default store
# Otherwise, return the key created by the default store
return
self
.
default_modulestore
.
make_course_key
(
org
,
course
,
run
)
return
self
.
default_modulestore
.
make_course_key
(
org
,
course
,
run
)
...
...
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