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
7b535846
Commit
7b535846
authored
May 08, 2015
by
Shrhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7621 from edx/shr/bug/TNL-1858-Unable-to-delete-studio-page
Delete static_tab for split courses raises 500 error
parents
710bb234
b7955fab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
cms/djangoapps/contentstore/views/tests/test_item.py
+6
-3
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+5
-1
No files found.
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
7b535846
...
@@ -27,7 +27,7 @@ from xmodule.capa_module import CapaDescriptor
...
@@ -27,7 +27,7 @@ from xmodule.capa_module import CapaDescriptor
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
TEST_DATA_SPLIT_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
TEST_DATA_SPLIT_MODULESTORE
from
xmodule.modulestore.tests.factories
import
ItemFactory
,
LibraryFactory
,
check_mongo_calls
from
xmodule.modulestore.tests.factories
import
ItemFactory
,
LibraryFactory
,
check_mongo_calls
,
CourseFactory
from
xmodule.x_module
import
STUDIO_VIEW
,
STUDENT_VIEW
from
xmodule.x_module
import
STUDIO_VIEW
,
STUDENT_VIEW
from
xblock.exceptions
import
NoSuchHandlerError
from
xblock.exceptions
import
NoSuchHandlerError
from
xblock_django.user_service
import
DjangoXBlockUserService
from
xblock_django.user_service
import
DjangoXBlockUserService
...
@@ -310,11 +310,14 @@ class GetItemTest(ItemTest):
...
@@ -310,11 +310,14 @@ class GetItemTest(ItemTest):
)
)
@ddt.ddt
class
DeleteItem
(
ItemTest
):
class
DeleteItem
(
ItemTest
):
"""Tests for '/xblock' DELETE url."""
"""Tests for '/xblock' DELETE url."""
def
test_delete_static_page
(
self
):
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_delete_static_page
(
self
,
store
):
course
=
CourseFactory
.
create
(
default_store
=
store
)
# Add static tab
# Add static tab
resp
=
self
.
create_xblock
(
category
=
'static_tab'
)
resp
=
self
.
create_xblock
(
category
=
'static_tab'
,
parent_usage_key
=
course
.
location
)
usage_key
=
self
.
response_usage_key
(
resp
)
usage_key
=
self
.
response_usage_key
(
resp
)
# Now delete it. There was a bug that the delete was failing (static tabs do not exist in draft modulestore).
# Now delete it. There was a bug that the delete was failing (static tabs do not exist in draft modulestore).
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
View file @
7b535846
...
@@ -213,7 +213,11 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli
...
@@ -213,7 +213,11 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli
parent_loc
=
self
.
get_parent_location
(
branched_location
)
parent_loc
=
self
.
get_parent_location
(
branched_location
)
SplitMongoModuleStore
.
delete_item
(
self
,
branched_location
,
user_id
)
SplitMongoModuleStore
.
delete_item
(
self
,
branched_location
,
user_id
)
# publish parent w/o child if deleted element is direct only (not based on type of parent)
# publish parent w/o child if deleted element is direct only (not based on type of parent)
if
branch
==
ModuleStoreEnum
.
BranchName
.
draft
and
branched_location
.
block_type
in
DIRECT_ONLY_CATEGORIES
:
if
(
branch
==
ModuleStoreEnum
.
BranchName
.
draft
and
branched_location
.
block_type
in
DIRECT_ONLY_CATEGORIES
and
parent_loc
):
# will publish if its not an orphan
self
.
publish
(
parent_loc
.
version_agnostic
(),
user_id
,
blacklist
=
EXCLUDE_ALL
,
**
kwargs
)
self
.
publish
(
parent_loc
.
version_agnostic
(),
user_id
,
blacklist
=
EXCLUDE_ALL
,
**
kwargs
)
def
_map_revision_to_branch
(
self
,
key
,
revision
=
None
):
def
_map_revision_to_branch
(
self
,
key
,
revision
=
None
):
...
...
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