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
325c3606
Commit
325c3606
authored
Dec 23, 2014
by
Braden MacDonald
Committed by
E. Kolpakov
Jan 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unrelated: fix two bugs when duplicating a LibraryContentModule
parent
3857a1c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
cms/djangoapps/contentstore/views/item.py
+6
-2
common/lib/xmodule/xmodule/modulestore/inheritance.py
+2
-2
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
325c3606
...
...
@@ -559,7 +559,10 @@ def _duplicate_item(parent_usage_key, duplicate_source_usage_key, user, display_
category
=
dest_usage_key
.
block_type
# Update the display name to indicate this is a duplicate (unless display name provided).
duplicate_metadata
=
own_metadata
(
source_item
)
duplicate_metadata
=
{}
# Can't use own_metadata(), b/c it converts data for JSON serialization - not suitable for setting metadata of the new block
for
field
in
source_item
.
fields
.
values
():
if
(
field
.
scope
==
Scope
.
settings
and
field
.
is_set_on
(
source_item
)):
duplicate_metadata
[
field
.
name
]
=
field
.
read_from
(
source_item
)
if
display_name
is
not
None
:
duplicate_metadata
[
'display_name'
]
=
display_name
else
:
...
...
@@ -584,7 +587,8 @@ def _duplicate_item(parent_usage_key, duplicate_source_usage_key, user, display_
dest_module
.
children
=
[]
for
child
in
source_item
.
children
:
dupe
=
_duplicate_item
(
dest_module
.
location
,
child
,
user
=
user
)
dest_module
.
children
.
append
(
dupe
)
if
dupe
not
in
dest_module
.
children
:
# _duplicate_item may add the child for us.
dest_module
.
children
.
append
(
dupe
)
store
.
update_item
(
dest_module
,
user
.
id
)
if
'detached'
not
in
source_item
.
runtime
.
load_block_type
(
category
)
.
_class_tags
:
...
...
common/lib/xmodule/xmodule/modulestore/inheritance.py
View file @
325c3606
...
...
@@ -211,8 +211,8 @@ def inherit_metadata(descriptor, inherited_data):
def
own_metadata
(
module
):
"""
Return a
dictionary that contains only non-inherited field keys,
mapped to their serialized values
Return a
JSON-friendly dictionary that contains only non-inherited field
keys,
mapped to their serialized values
"""
return
module
.
get_explicitly_set_fields_by_scope
(
Scope
.
settings
)
...
...
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