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
70d5ec6e
Commit
70d5ec6e
authored
Aug 14, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it clear that get_course_for_item is only a helper method in mongo modulestore.
parent
e0aa46ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+4
-4
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
70d5ec6e
...
...
@@ -681,7 +681,7 @@ class MongoModuleStore(ModuleStoreBase):
# we should remove this once we can break this reference from the course to static tabs
# TODO move this special casing to app tier (similar to attaching new element to parent)
if
location
.
category
==
'static_tab'
:
course
=
self
.
get_course_for_item
(
location
)
course
=
self
.
_
get_course_for_item
(
location
)
existing_tabs
=
course
.
tabs
or
[]
existing_tabs
.
append
({
'type'
:
'static_tab'
,
...
...
@@ -701,7 +701,7 @@ class MongoModuleStore(ModuleStoreBase):
self
.
modulestore_update_signal
.
send
(
self
,
modulestore
=
self
,
course_id
=
course_id
,
location
=
location
)
def
get_course_for_item
(
self
,
location
,
depth
=
0
):
def
_
get_course_for_item
(
self
,
location
,
depth
=
0
):
'''
VS[compat]
cdodge: for a given Xmodule, return the course that it belongs to
...
...
@@ -790,7 +790,7 @@ class MongoModuleStore(ModuleStoreBase):
# we should remove this once we can break this reference from the course to static tabs
loc
=
Location
(
location
)
if
loc
.
category
==
'static_tab'
:
course
=
self
.
get_course_for_item
(
loc
)
course
=
self
.
_
get_course_for_item
(
loc
)
existing_tabs
=
course
.
tabs
or
[]
for
tab
in
existing_tabs
:
if
tab
.
get
(
'url_slug'
)
==
loc
.
name
:
...
...
@@ -818,7 +818,7 @@ class MongoModuleStore(ModuleStoreBase):
# we should remove this once we can break this reference from the course to static tabs
if
location
.
category
==
'static_tab'
:
item
=
self
.
get_item
(
location
)
course
=
self
.
get_course_for_item
(
item
.
location
)
course
=
self
.
_
get_course_for_item
(
item
.
location
)
existing_tabs
=
course
.
tabs
or
[]
course
.
tabs
=
[
tab
for
tab
in
existing_tabs
if
tab
.
get
(
'url_slug'
)
!=
location
.
name
]
# Save the updates to the course to the MongoKeyValueStore
...
...
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