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
ee401f15
Commit
ee401f15
authored
Mar 27, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make mongo/draft.py pass the active descriptor system through item loading
parent
bf62c4b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
+10
-3
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
View file @
ee401f15
...
@@ -47,7 +47,7 @@ class DraftModuleStore(MongoModuleStore):
...
@@ -47,7 +47,7 @@ class DraftModuleStore(MongoModuleStore):
This module also includes functionality to promote DRAFT modules (and their children)
This module also includes functionality to promote DRAFT modules (and their children)
to published modules.
to published modules.
"""
"""
def
get_item
(
self
,
usage_key
,
depth
=
0
,
revision
=
None
,
**
kwargs
):
def
get_item
(
self
,
usage_key
,
depth
=
0
,
revision
=
None
,
using_descriptor_system
=
None
,
**
kwargs
):
"""
"""
Returns an XModuleDescriptor instance for the item at usage_key.
Returns an XModuleDescriptor instance for the item at usage_key.
...
@@ -70,6 +70,9 @@ class DraftModuleStore(MongoModuleStore):
...
@@ -70,6 +70,9 @@ class DraftModuleStore(MongoModuleStore):
Note: If the item is in DIRECT_ONLY_CATEGORIES, then returns only the PUBLISHED
Note: If the item is in DIRECT_ONLY_CATEGORIES, then returns only the PUBLISHED
version regardless of the revision.
version regardless of the revision.
using_descriptor_system (CachingDescriptorSystem): The existing CachingDescriptorSystem
to add data to, and to load the XBlocks from.
Raises:
Raises:
xmodule.modulestore.exceptions.InsufficientSpecificationError
xmodule.modulestore.exceptions.InsufficientSpecificationError
if any segment of the usage_key is None except revision
if any segment of the usage_key is None except revision
...
@@ -78,10 +81,14 @@ class DraftModuleStore(MongoModuleStore):
...
@@ -78,10 +81,14 @@ class DraftModuleStore(MongoModuleStore):
is found at that usage_key
is found at that usage_key
"""
"""
def
get_published
():
def
get_published
():
return
wrap_draft
(
super
(
DraftModuleStore
,
self
)
.
get_item
(
usage_key
,
depth
=
depth
))
return
wrap_draft
(
super
(
DraftModuleStore
,
self
)
.
get_item
(
usage_key
,
depth
=
depth
,
using_descriptor_system
=
using_descriptor_system
))
def
get_draft
():
def
get_draft
():
return
wrap_draft
(
super
(
DraftModuleStore
,
self
)
.
get_item
(
as_draft
(
usage_key
),
depth
=
depth
))
return
wrap_draft
(
super
(
DraftModuleStore
,
self
)
.
get_item
(
as_draft
(
usage_key
),
depth
=
depth
,
using_descriptor_system
=
using_descriptor_system
))
# return the published version if ModuleStoreEnum.RevisionOption.published_only is requested
# return the published version if ModuleStoreEnum.RevisionOption.published_only is requested
if
revision
==
ModuleStoreEnum
.
RevisionOption
.
published_only
:
if
revision
==
ModuleStoreEnum
.
RevisionOption
.
published_only
:
...
...
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