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
8a9845c2
Commit
8a9845c2
authored
Dec 23, 2015
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ModuleStoreEnum.Type.xml
parent
91c94977
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
13 additions
and
60 deletions
+13
-60
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
+0
-4
common/djangoapps/static_replace/__init__.py
+1
-2
common/djangoapps/student/views.py
+0
-1
common/lib/xmodule/xmodule/modulestore/__init__.py
+0
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+2
-5
common/lib/xmodule/xmodule/modulestore/tests/test_xml.py
+0
-4
common/lib/xmodule/xmodule/modulestore/xml.py
+2
-2
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+1
-3
lms/djangoapps/bulk_email/forms.py
+0
-7
lms/djangoapps/courseware/courses.py
+1
-3
lms/djangoapps/dashboard/sysadmin.py
+1
-17
lms/djangoapps/instructor/views/tools.py
+1
-2
lms/lib/xblock/test/test_mixin.py
+2
-6
openedx/core/lib/courses.py
+1
-1
openedx/core/lib/xblock_utils.py
+1
-2
No files found.
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
View file @
8a9845c2
...
...
@@ -29,10 +29,6 @@ class TestArgParsing(unittest.TestCase):
with
self
.
assertRaises
(
CommandError
):
self
.
command
.
handle
(
"foo"
,
"user@foo.org"
,
"org"
,
"course"
,
"run"
)
def
test_xml_store
(
self
):
with
self
.
assertRaises
(
CommandError
):
self
.
command
.
handle
(
ModuleStoreEnum
.
Type
.
xml
,
"user@foo.org"
,
"org"
,
"course"
,
"run"
)
def
test_nonexistent_user_id
(
self
):
errstring
=
"No user 99 found"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
...
...
common/djangoapps/static_replace/__init__.py
View file @
8a9845c2
...
...
@@ -164,8 +164,7 @@ def replace_static_urls(text, data_directory=None, course_id=None, static_asset_
return
original
# if we're running with a MongoBacked store course_namespace is not None, then use studio style urls
elif
(
not
static_asset_path
)
\
and
course_id
\
and
modulestore
()
.
get_modulestore_type
(
course_id
)
!=
ModuleStoreEnum
.
Type
.
xml
:
and
course_id
:
# first look in the static file pipeline and see if we are trying to reference
# a piece of static content which is in the edx-platform repo (e.g. JS associated with an xmodule)
...
...
common/djangoapps/student/views.py
View file @
8a9845c2
...
...
@@ -649,7 +649,6 @@ def dashboard(request):
show_email_settings_for
=
frozenset
(
enrollment
.
course_id
for
enrollment
in
course_enrollments
if
(
settings
.
FEATURES
[
'ENABLE_INSTRUCTOR_EMAIL'
]
and
modulestore
()
.
get_modulestore_type
(
enrollment
.
course_id
)
!=
ModuleStoreEnum
.
Type
.
xml
and
CourseAuthorization
.
instructor_email_enabled
(
enrollment
.
course_id
)
)
)
...
...
common/lib/xmodule/xmodule/modulestore/__init__.py
View file @
8a9845c2
...
...
@@ -55,7 +55,6 @@ class ModuleStoreEnum(object):
"""
split
=
'split'
mongo
=
'mongo'
xml
=
'xml'
class
RevisionOption
(
object
):
"""
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
8a9845c2
...
...
@@ -1991,11 +1991,8 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
self
.
assertEquals
(
store
.
get_modulestore_type
(),
store_type
)
# verify store used for creating a course
try
:
course
=
self
.
store
.
create_course
(
"org"
,
"course{}"
.
format
(
uuid4
()
.
hex
[:
5
]),
"run"
,
self
.
user_id
)
self
.
assertEquals
(
course
.
system
.
modulestore
.
get_modulestore_type
(),
store_type
)
except
NotImplementedError
:
self
.
assertEquals
(
store_type
,
ModuleStoreEnum
.
Type
.
xml
)
course
=
self
.
store
.
create_course
(
"org"
,
"course{}"
.
format
(
uuid4
()
.
hex
[:
5
]),
"run"
,
self
.
user_id
)
self
.
assertEquals
(
course
.
system
.
modulestore
.
get_modulestore_type
(),
store_type
)
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_default_store
(
self
,
default_ms
):
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_xml.py
View file @
8a9845c2
...
...
@@ -31,10 +31,6 @@ class TestXMLModuleStore(unittest.TestCase):
"""
Test around the XML modulestore
"""
def
test_xml_modulestore_type
(
self
):
store
=
XMLModuleStore
(
DATA_DIR
,
source_dirs
=
[])
self
.
assertEqual
(
store
.
get_modulestore_type
(),
ModuleStoreEnum
.
Type
.
xml
)
@patch
(
'xmodule.tabs.CourseTabList.initialize_default'
,
Mock
())
def
test_unicode_chars_in_xml_content
(
self
):
# edX/full/6.002_Spring_2012 has non-ASCII chars, and during
...
...
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
8a9845c2
...
...
@@ -875,7 +875,7 @@ class XMLModuleStore(ModuleStoreReadBase):
Args:
course_key: just for signature compatibility
"""
return
ModuleStoreEnum
.
Type
.
xml
return
None
#
ModuleStoreEnum.Type.xml
def
get_courses_for_wiki
(
self
,
wiki_slug
,
**
kwargs
):
"""
...
...
@@ -893,7 +893,7 @@ class XMLModuleStore(ModuleStoreReadBase):
Returns the course count
"""
return
{
ModuleStoreEnum
.
Type
.
xml
:
True
}
return
{
'xml'
:
True
}
@contextmanager
def
branch_setting
(
self
,
branch_setting
,
course_id
=
None
):
# pylint: disable=unused-argument
...
...
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
8a9845c2
...
...
@@ -279,9 +279,7 @@ class CourseExportManager(ExportManager):
policy
=
{
'course/'
+
courselike
.
location
.
name
:
own_metadata
(
courselike
)}
course_policy
.
write
(
dumps
(
policy
,
cls
=
EdxJSONEncoder
,
sort_keys
=
True
,
indent
=
4
))
# xml backed courses don't support drafts!
if
courselike
.
runtime
.
modulestore
.
get_modulestore_type
()
!=
ModuleStoreEnum
.
Type
.
xml
:
_export_drafts
(
self
.
modulestore
,
self
.
courselike_key
,
export_fs
,
xml_centric_courselike_key
)
_export_drafts
(
self
.
modulestore
,
self
.
courselike_key
,
export_fs
,
xml_centric_courselike_key
)
class
LibraryExportManager
(
ExportManager
):
...
...
lms/djangoapps/bulk_email/forms.py
View file @
8a9845c2
...
...
@@ -100,11 +100,4 @@ class CourseAuthorizationAdminForm(forms.ModelForm):
msg
+=
'Please recheck that you have supplied a valid course id.'
raise
forms
.
ValidationError
(
msg
)
# Now, try and discern if it is a Studio course - HTML editor doesn't work with XML courses
is_studio_course
=
modulestore
()
.
get_modulestore_type
(
course_key
)
!=
ModuleStoreEnum
.
Type
.
xml
if
not
is_studio_course
:
msg
=
"Course Email feature is only available for courses authored in Studio. "
msg
+=
'"{0}" appears to be an XML backed course.'
.
format
(
course_key
.
to_deprecated_string
())
raise
forms
.
ValidationError
(
msg
)
return
course_key
lms/djangoapps/courseware/courses.py
View file @
8a9845c2
...
...
@@ -453,10 +453,8 @@ def get_studio_url(course, page):
Args:
course (CourseDescriptor)
"""
is_studio_course
=
course
.
course_edit_method
==
"Studio"
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
course
.
id
)
!=
ModuleStoreEnum
.
Type
.
xml
studio_link
=
None
if
is_studio_course
and
is_mongo_course
:
if
course
.
course_edit_method
==
"Studio"
:
studio_link
=
get_cms_course_link
(
course
,
page
)
return
studio_link
...
...
lms/djangoapps/dashboard/sysadmin.py
View file @
8a9845c2
...
...
@@ -491,23 +491,7 @@ class Courses(SysadminDashboardView):
escape
(
str
(
err
))
)
is_xml_course
=
(
modulestore
()
.
get_modulestore_type
(
course_key
)
==
ModuleStoreEnum
.
Type
.
xml
)
if
course_found
and
is_xml_course
:
cdir
=
course
.
data_dir
self
.
def_ms
.
courses
.
pop
(
cdir
)
# now move the directory (don't actually delete it)
new_dir
=
"{course_dir}_deleted_{timestamp}"
.
format
(
course_dir
=
cdir
,
timestamp
=
int
(
time
.
time
())
)
os
.
rename
(
settings
.
DATA_DIR
/
cdir
,
settings
.
DATA_DIR
/
new_dir
)
self
.
msg
+=
(
u"<font color='red'>Deleted "
u"{0} = {1} ({2})</font>"
.
format
(
cdir
,
course
.
id
,
course
.
display_name
))
elif
course_found
and
not
is_xml_course
:
if
course_found
:
# delete course that is stored with mongodb backend
self
.
def_ms
.
delete_course
(
course
.
id
,
request
.
user
.
id
)
# don't delete user permission groups, though
...
...
lms/djangoapps/instructor/views/tools.py
View file @
8a9845c2
...
...
@@ -66,10 +66,9 @@ def bulk_email_is_enabled_for_course(course_id):
"""
bulk_email_enabled_globally
=
(
settings
.
FEATURES
[
'ENABLE_INSTRUCTOR_EMAIL'
]
is
True
)
is_studio_course
=
(
modulestore
()
.
get_modulestore_type
(
course_id
)
!=
ModuleStoreEnum
.
Type
.
xml
)
bulk_email_enabled_for_course
=
CourseAuthorization
.
instructor_email_enabled
(
course_id
)
if
bulk_email_enabled_globally
and
is_studio_course
and
bulk_email_enabled_for_course
:
if
bulk_email_enabled_globally
and
bulk_email_enabled_for_course
:
return
True
return
False
...
...
lms/lib/xblock/test/test_mixin.py
View file @
8a9845c2
...
...
@@ -159,19 +159,15 @@ class XBlockGetParentTest(LmsXBlockMixinTestCase):
"""
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
,
ModuleStoreEnum
.
Type
.
xml
)
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_parents
(
self
,
modulestore_type
):
with
self
.
store
.
default_store
(
modulestore_type
):
# setting up our own local course tree here, since it needs to be
# created with the correct modulestore type.
if
modulestore_type
==
'xml'
:
course_key
=
self
.
store
.
make_course_key
(
'edX'
,
'toy'
,
'2012_Fall'
)
else
:
course_key
=
ToyCourseFactory
.
create
(
run
=
'2012_Fall_copy'
)
.
id
course_key
=
ToyCourseFactory
.
create
()
.
id
course
=
self
.
store
.
get_course
(
course_key
)
self
.
assertIsNone
(
course
.
get_parent
())
def
recurse
(
parent
):
...
...
openedx/core/lib/courses.py
View file @
8a9845c2
...
...
@@ -13,7 +13,7 @@ from xmodule.modulestore import ModuleStoreEnum
def
course_image_url
(
course
):
"""Try to look up the image url for the course. If it's not found,
log an error and return the dead link"""
if
course
.
static_asset_path
or
modulestore
()
.
get_modulestore_type
(
course
.
id
)
==
ModuleStoreEnum
.
Type
.
xml
:
if
course
.
static_asset_path
:
# If we are a static course with the course_image attribute
# set different than the default, return that path so that
# courses can use custom course image paths, otherwise just
...
...
openedx/core/lib/xblock_utils.py
View file @
8a9845c2
...
...
@@ -300,10 +300,9 @@ def add_staff_markup(user, has_instructor_access, disable_staff_debug_info, bloc
# TODO: make this more general, eg use an XModule attribute instead
if
isinstance
(
block
,
VerticalBlock
)
and
(
not
context
or
not
context
.
get
(
'child_of_vertical'
,
False
)):
# check that the course is a mongo backed Studio course before doing work
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
block
.
location
.
course_key
)
!=
ModuleStoreEnum
.
Type
.
xml
is_studio_course
=
block
.
course_edit_method
==
"Studio"
if
is_studio_course
and
is_mongo_course
:
if
is_studio_course
:
# build edit link to unit in CMS. Can't use reverse here as lms doesn't load cms's urls.py
edit_link
=
"//"
+
settings
.
CMS_BASE
+
'/container/'
+
unicode
(
block
.
location
)
...
...
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