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
102c594e
Commit
102c594e
authored
Mar 05, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove string and old import
parent
9475c6ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
16 deletions
+0
-16
cms/djangoapps/contentstore/views.py
+0
-16
No files found.
cms/djangoapps/contentstore/views.py
View file @
102c594e
from
util.json_request
import
expect_json
import
json
import
ast
import
logging
import
os
import
sys
...
...
@@ -292,21 +291,6 @@ def edit_unit(request, location):
course_metadata
=
CourseMetadata
.
fetch
(
course
.
location
)
course_advanced_keys
=
course_metadata
.
get
(
ADVANCED_COMPONENT_POLICY_KEY
,
[])
# We expect the advanced keys to be a *list* of strings, but if it is a JSON-encoded string, attempt to parse it.
if
isinstance
(
course_advanced_keys
,
basestring
):
# Are you JSON?
try
:
course_advanced_keys
=
json
.
loads
(
course_advanced_keys
)
except
:
log
.
error
(
"Cannot JSON decode course advanced policy: {0}"
.
format
(
course_advanced_keys
))
# Not JSON? How about Python?
try
:
#This is a safe evaluation. See docs for ast
course_advanced_keys
=
ast
.
literal_eval
(
course_advanced_keys
)
except
:
log
.
error
(
"Cannot parse course advanced policy at all: {0}"
.
format
(
course_advanced_keys
))
course_advanced_keys
=
[]
# Set component types according to course policy file
component_types
=
list
(
COMPONENT_TYPES
)
if
isinstance
(
course_advanced_keys
,
list
):
...
...
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