Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
692502c0
Commit
692502c0
authored
11 years ago
by
David Baumgold
Browse files
Options
Downloads
Patches
Plain Diff
Don't cache falsy values
parent
3eee6589
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
+4
-0
4 additions, 0 deletions
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
+4
-4
4 additions, 4 deletions
...xmodule/xmodule/modulestore/tests/test_location_mapper.py
with
8 additions
and
4 deletions
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
+
4
−
0
View file @
692502c0
...
...
@@ -404,6 +404,8 @@ class LocMapperStore(object):
"""
Get the course Locator for this old course id
"""
if
not
old_course_id
:
return
None
entry
=
self
.
cache
.
get
(
old_course_id
)
if
entry
is
not
None
:
if
published
:
...
...
@@ -428,6 +430,8 @@ class LocMapperStore(object):
"""
For quick lookup of courses
"""
if
not
old_course_id
:
return
self
.
cache
.
set
(
old_course_id
,
(
published_course_locator
,
draft_course_locator
))
def
_cache_location_map_entry
(
self
,
old_course_id
,
location
,
published_usage
,
draft_usage
):
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
+
4
−
4
View file @
692502c0
...
...
@@ -80,8 +80,8 @@ class TestLocationMapper(unittest.TestCase):
Request translation, check package_id, block_id, and branch
"""
prob_locator
=
loc_mapper
().
translate_location
(
old_style_course_id
,
location
,
old_style_course_id
,
location
,
published
=
(
branch
==
'
published
'
),
add_entry_if_missing
=
add_entry
)
...
...
@@ -114,7 +114,7 @@ class TestLocationMapper(unittest.TestCase):
new_style_package_id
=
'
{}.geek_dept.{}.baz_run
'
.
format
(
org
,
course
)
block_map
=
{
'
abc123
'
:
{
'
problem
'
:
'
problem2
'
},
'
abc123
'
:
{
'
problem
'
:
'
problem2
'
},
'
def456
'
:
{
'
problem
'
:
'
problem4
'
},
'
ghi789
'
:
{
'
problem
'
:
'
problem7
'
},
}
...
...
@@ -139,7 +139,7 @@ class TestLocationMapper(unittest.TestCase):
# add a distractor course (note that abc123 has a different translation in this one)
distractor_block_map
=
{
'
abc123
'
:
{
'
problem
'
:
'
problem3
'
},
'
abc123
'
:
{
'
problem
'
:
'
problem3
'
},
'
def456
'
:
{
'
problem
'
:
'
problem4
'
},
'
ghi789
'
:
{
'
problem
'
:
'
problem7
'
},
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment