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
7c3d5d58
Commit
7c3d5d58
authored
Oct 09, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up how parent locations interact w/ draft mode when creating new units
parent
2f675be2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
cms/djangoapps/contentstore/views.py
+6
-1
common/lib/xmodule/xmodule/modulestore/draft.py
+9
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
7c3d5d58
...
...
@@ -571,7 +571,12 @@ def clone_item(request):
new_item
.
metadata
[
'display_name'
]
=
display_name
modulestore
()
.
update_metadata
(
new_item
.
location
.
url
(),
new_item
.
own_metadata
)
modulestore
()
.
update_children
(
parent_location
,
parent
.
definition
.
get
(
'children'
,
[])
+
[
new_item
.
location
.
url
()])
if
parent_location
.
category
not
in
(
'vertical'
,):
parent_update_modulestore
=
modulestore
(
'direct'
)
else
:
parent_update_modulestore
=
modulestore
()
parent_update_modulestore
.
update_children
(
parent_location
,
parent
.
definition
.
get
(
'children'
,
[])
+
[
new_item
.
location
.
url
()])
return
HttpResponse
(
json
.
dumps
({
'id'
:
dest_location
.
url
()}))
...
...
common/lib/xmodule/xmodule/modulestore/draft.py
View file @
7c3d5d58
...
...
@@ -100,7 +100,7 @@ class DraftModuleStore(ModuleStoreBase):
Clone a new item that is a copy of the item at the location `source`
and writes it to `location`
"""
return
super
(
DraftModuleStore
,
self
)
.
clone_item
(
source
,
as_draft
(
location
))
return
wrap_draft
(
super
(
DraftModuleStore
,
self
)
.
clone_item
(
source
,
as_draft
(
location
)
))
def
update_item
(
self
,
location
,
data
):
"""
...
...
@@ -159,6 +159,14 @@ class DraftModuleStore(ModuleStoreBase):
"""
return
super
(
DraftModuleStore
,
self
)
.
delete_item
(
as_draft
(
location
))
def
get_parent_locations
(
self
,
location
):
'''Find all locations that are the parents of this location. Needed
for path_to_location().
returns an iterable of things that can be passed to Location.
'''
return
super
(
DraftModuleStore
,
self
)
.
get_parent_locations
(
location
)
def
publish
(
self
,
location
,
published_by_id
):
"""
Save a current draft to the underlying modulestore
...
...
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