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
7a8e43a9
Commit
7a8e43a9
authored
Mar 01, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Json parsing fixes
parent
386ab10e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
cms/djangoapps/contentstore/views.py
+9
-3
No files found.
cms/djangoapps/contentstore/views.py
View file @
7a8e43a9
...
...
@@ -73,8 +73,7 @@ ADVANCED_COMPONENT_TYPES = {
'advanced'
:
[
'annotation'
]
}
ADVANCED_COMPONENT_CATEGORY
=
'advanced'
ADVANCED_COMPONENT_POLICY_KEY
=
'enable_advanced_modules'
ADVANCED_COMPONENT_POLICY_KEY
=
'advanced_modules'
# cdodge: these are categories which should not be parented, they are detached from the hierarchy
DETACHED_CATEGORIES
=
[
'about'
,
'static_tab'
,
'course_info'
]
...
...
@@ -293,16 +292,23 @@ def edit_unit(request, location):
advanced_component_types
=
ADVANCED_COMPONENT_TYPES
course_metadata
=
CourseMetadata
.
fetch
(
course
.
location
)
course_advanced_keys
=
course_metadata
.
get
(
ADVANCED_COMPONENT_POLICY_KEY
,
{})
try
:
course_advanced_keys
=
json
.
loads
(
course_advanced_keys
)
except
:
log
.
error
(
"Cannot json decode course advanced policy: {0}"
.
format
(
course_advanced_keys
))
if
isinstance
(
course_advanced_keys
,
dict
):
advanced_component_types
.
update
(
course_advanced_keys
)
else
:
log
.
error
(
"Improper format for course advanced keys! {0}"
.
format
(
course_advanced_keys
))
templates
=
modulestore
()
.
get_items
(
Location
(
'i4x'
,
'edx'
,
'templates'
))
for
template
in
templates
:
category
=
template
.
location
.
category
log
.
debug
(
category
)
for
key
in
ADVANCED_COMPONENT_TYPES
:
if
template
.
location
.
category
in
ADVANCED_COMPONENT_TYPES
[
key
]:
if
category
in
ADVANCED_COMPONENT_TYPES
[
key
]:
category
=
key
break
...
...
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