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
8e36197c
Commit
8e36197c
authored
Apr 05, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweeks per Cale's feedback
parent
73113edd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
cms/djangoapps/contentstore/management/commands/check_course.py
+4
-5
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+5
-4
No files found.
cms/djangoapps/contentstore/management/commands/check_course.py
View file @
8e36197c
...
...
@@ -9,7 +9,7 @@ from request_cache.middleware import RequestCache
from
django.core.cache
import
get_cache
,
InvalidCacheBackendError
class
Command
(
BaseCommand
):
help
=
'''
Delete a MongoDB backed course
'''
help
=
'''
Enumerates through the course and find common errors
'''
def
handle
(
self
,
*
args
,
**
options
):
if
len
(
args
)
!=
1
:
...
...
@@ -38,10 +38,9 @@ class Command(BaseCommand):
# we've had a bug where the xml_attributes field can we rewritten as a string rather than a dict
def
_check_xml_attributes_field
(
module
):
err_cnt
=
0
if
hasattr
(
module
,
'xml_attributes'
):
if
isinstance
(
module
.
xml_attributes
,
str
)
or
isinstance
(
module
.
xml_attributes
,
unicode
):
print
'module = {0} has xml_attributes as a string. It should be a dict'
.
format
(
module
.
location
.
url
())
err_cnt
=
err_cnt
+
1
if
hasattr
(
module
,
'xml_attributes'
)
and
isinstance
(
module
.
xml_attributes
,
basestring
):
print
'module = {0} has xml_attributes as a string. It should be a dict'
.
format
(
module
.
location
.
url
())
err_cnt
=
err_cnt
+
1
for
child
in
module
.
get_children
():
err_cnt
=
err_cnt
+
_check_xml_attributes_field
(
child
)
return
err_cnt
...
...
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
8e36197c
...
...
@@ -379,10 +379,11 @@ def check_module_metadata_editability(module):
allowed
=
allowed
+
[
'xml_attributes'
,
'display_name'
]
err_cnt
=
0
my_metadata
=
dict
(
own_metadata
(
module
))
for
key
in
my_metadata
.
keys
():
if
key
not
in
allowed
:
err_cnt
=
err_cnt
+
1
print
': found metadata on {0}. Studio will not support editing this piece of metadata, so it is not allowed. Metadata: {1} = {2}'
.
format
(
module
.
location
.
url
(),
key
,
my_metadata
[
key
])
illegal_keys
=
set
(
own_metadata
(
module
)
.
keys
())
-
set
(
allowed
)
if
len
(
illegal_keys
)
>
0
:
err_cnt
=
err_cnt
+
1
print
': found non-editable metadata on {0}. These metadata keys are not supported = {1}'
.
format
(
module
.
location
.
url
(),
illegal_keys
)
return
err_cnt
...
...
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