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
8d8fa0fa
Commit
8d8fa0fa
authored
Apr 02, 2015
by
Braden MacDonald
Committed by
Jonathan Piacenti
Apr 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial fix perhaps?
parent
78163455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
common/lib/xmodule/xmodule/library_tools.py
+4
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+3
-3
No files found.
common/lib/xmodule/xmodule/library_tools.py
View file @
8d8fa0fa
...
@@ -4,6 +4,7 @@ XBlock runtime services for LibraryContentModule
...
@@ -4,6 +4,7 @@ XBlock runtime services for LibraryContentModule
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
from
opaque_keys.edx.locator
import
LibraryLocator
from
opaque_keys.edx.locator
import
LibraryLocator
from
xmodule.library_content_module
import
ANY_CAPA_TYPE_VALUE
from
xmodule.library_content_module
import
ANY_CAPA_TYPE_VALUE
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.capa_module
import
CapaDescriptor
from
xmodule.capa_module
import
CapaDescriptor
...
@@ -125,7 +126,9 @@ class LibraryToolsService(object):
...
@@ -125,7 +126,9 @@ class LibraryToolsService(object):
return
return
source_blocks
=
[]
source_blocks
=
[]
library_key
=
dest_block
.
source_library_key
.
for_version
(
version
)
library_key
=
dest_block
.
source_library_key
if
version
:
library_key
=
library_key
.
replace
(
branch
=
ModuleStoreEnum
.
BranchName
.
library
,
version_guid
=
version
)
library
=
self
.
_get_library
(
library_key
)
library
=
self
.
_get_library
(
library_key
)
if
library
is
None
:
if
library
is
None
:
raise
ValueError
(
"Requested library not found."
)
raise
ValueError
(
"Requested library not found."
)
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
8d8fa0fa
...
@@ -2205,7 +2205,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -2205,7 +2205,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
# so that we can access descendant information quickly
# so that we can access descendant information quickly
source_structures
=
{}
source_structures
=
{}
for
key
in
source_keys
:
for
key
in
source_keys
:
course_key
=
key
.
course_key
.
for_version
(
None
)
course_key
=
key
.
course_key
if
course_key
.
branch
is
None
:
if
course_key
.
branch
is
None
:
raise
ItemNotFoundError
(
"branch is required for all source keys when using copy_from_template"
)
raise
ItemNotFoundError
(
"branch is required for all source keys when using copy_from_template"
)
if
course_key
not
in
source_structures
:
if
course_key
not
in
source_structures
:
...
@@ -2264,9 +2264,9 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -2264,9 +2264,9 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
new_children
=
list
()
# ordered list of the new children of new_parent_block_key
new_children
=
list
()
# ordered list of the new children of new_parent_block_key
for
usage_key
in
source_keys
:
for
usage_key
in
source_keys
:
src_course_key
=
usage_key
.
course_key
.
for_version
(
None
)
src_course_key
=
usage_key
.
course_key
block_key
=
BlockKey
(
usage_key
.
block_type
,
usage_key
.
block_id
)
block_key
=
BlockKey
(
usage_key
.
block_type
,
usage_key
.
block_id
)
source_structure
=
source_structures
.
get
(
src_course_key
,
[])
source_structure
=
source_structures
[
src_course_key
]
if
block_key
not
in
source_structure
[
'blocks'
]:
if
block_key
not
in
source_structure
[
'blocks'
]:
raise
ItemNotFoundError
(
usage_key
)
raise
ItemNotFoundError
(
usage_key
)
source_block_info
=
source_structure
[
'blocks'
][
block_key
]
source_block_info
=
source_structure
[
'blocks'
][
block_key
]
...
...
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