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
80b5f382
Commit
80b5f382
authored
Feb 24, 2015
by
John Eskew
Committed by
Waqas Khalid
Feb 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upon import, only raise when none of multiple parents are found for a
block.
parent
78079213
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+13
-8
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
80b5f382
...
...
@@ -2118,16 +2118,21 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
if
BlockKey
.
from_usage_key
(
subtree_root
)
!=
source_structure
[
'root'
]:
# find the parents and put root in the right sequence
parents
=
self
.
_get_parents_from_structure
(
BlockKey
.
from_usage_key
(
subtree_root
),
source_structure
)
parent_found
=
False
for
parent
in
parents
:
if
parent
not
in
destination_blocks
:
raise
ItemNotFoundError
(
parent
)
orphans
.
update
(
self
.
_sync_children
(
source_structure
[
'blocks'
][
parent
],
destination_blocks
[
parent
],
BlockKey
.
from_usage_key
(
subtree_root
)
# If a parent isn't found in the destination_blocks, it's possible it was renamed
# in the course export. Continue and only throw an exception if *no* parents are found.
if
parent
in
destination_blocks
:
parent_found
=
True
orphans
.
update
(
self
.
_sync_children
(
source_structure
[
'blocks'
][
parent
],
destination_blocks
[
parent
],
BlockKey
.
from_usage_key
(
subtree_root
)
)
)
)
if
len
(
parents
)
and
not
parent_found
:
raise
ItemNotFoundError
(
parents
)
# update/create the subtree and its children in destination (skipping blacklist)
orphans
.
update
(
self
.
_copy_subdag
(
...
...
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