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
f19605af
Commit
f19605af
authored
Sep 28, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a clearer error message when split is unable to delete an XBlock
parent
6da7bff1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+4
-1
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
f19605af
...
@@ -2382,7 +2382,10 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -2382,7 +2382,10 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
if
original_structure
[
'root'
]
==
block_key
:
if
original_structure
[
'root'
]
==
block_key
:
raise
ValueError
(
"Cannot delete the root of a course"
)
raise
ValueError
(
"Cannot delete the root of a course"
)
if
block_key
not
in
original_structure
[
'blocks'
]:
if
block_key
not
in
original_structure
[
'blocks'
]:
raise
ValueError
(
"Cannot delete a block that does not exist"
)
raise
ValueError
(
"Cannot delete block_key {} from course {}, because that block does not exist."
.
format
(
block_key
,
usage_locator
,
))
index_entry
=
self
.
_get_index_if_valid
(
usage_locator
.
course_key
,
force
)
index_entry
=
self
.
_get_index_if_valid
(
usage_locator
.
course_key
,
force
)
new_structure
=
self
.
version_structure
(
usage_locator
.
course_key
,
original_structure
,
user_id
)
new_structure
=
self
.
version_structure
(
usage_locator
.
course_key
,
original_structure
,
user_id
)
new_blocks
=
new_structure
[
'blocks'
]
new_blocks
=
new_structure
[
'blocks'
]
...
...
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