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
99dccf98
Commit
99dccf98
authored
May 26, 2016
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not require restating LMS to pick up disabled xblock change.
parent
cc7017e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletions
+41
-1
common/lib/xmodule/xmodule/modulestore/django.py
+12
-0
common/lib/xmodule/xmodule/modulestore/mixed.py
+12
-0
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+8
-0
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+9
-1
No files found.
common/lib/xmodule/xmodule/modulestore/django.py
View file @
99dccf98
...
@@ -48,6 +48,9 @@ try:
...
@@ -48,6 +48,9 @@ try:
except
ImportError
:
except
ImportError
:
HAS_USER_SERVICE
=
False
HAS_USER_SERVICE
=
False
from
django.dispatch
import
receiver
from
django.db.models.signals
import
post_save
try
:
try
:
from
xblock_django.models
import
XBlockConfigFlag
,
XBlockConfig
from
xblock_django.models
import
XBlockConfigFlag
,
XBlockConfig
except
ImportError
:
except
ImportError
:
...
@@ -252,6 +255,15 @@ def clear_existing_modulestores():
...
@@ -252,6 +255,15 @@ def clear_existing_modulestores():
_MIXED_MODULESTORE
=
None
_MIXED_MODULESTORE
=
None
@receiver
(
post_save
,
sender
=
XBlockConfig
)
def
reset_disabled_xblocks
(
sender
,
instance
,
**
kwargs
):
# pylint: disable=unused-argument, invalid-name
if
XBlockConfigFlag
and
XBlockConfigFlag
.
is_enabled
():
# TODO make this method smarter so we only reset the list if the modified
# xblock either was in disabled_xblock_types or is now disabled.
disabled_xblock_types
=
[
block
.
name
for
block
in
XBlockConfig
.
disabled_xblocks
()]
modulestore
()
.
disabled_xblock_types
=
disabled_xblock_types
class
ModuleI18nService
(
object
):
class
ModuleI18nService
(
object
):
"""
"""
Implement the XBlock runtime "i18n" service.
Implement the XBlock runtime "i18n" service.
...
...
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
99dccf98
...
@@ -310,6 +310,18 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
...
@@ -310,6 +310,18 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
course_summaries
[
course_id
]
=
course_summary
course_summaries
[
course_id
]
=
course_summary
return
course_summaries
.
values
()
return
course_summaries
.
values
()
@property
def
disabled_xblock_types
(
self
):
return
self
.
_disabled_xblock_types
@disabled_xblock_types.setter
def
disabled_xblock_types
(
self
,
value
):
self
.
_disabled_xblock_types
=
value
if
hasattr
(
self
,
'modulestores'
):
for
store
in
self
.
modulestores
:
store
.
disabled_xblock_types
=
value
@strip_key
@strip_key
def
get_courses
(
self
,
**
kwargs
):
def
get_courses
(
self
,
**
kwargs
):
'''
'''
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
99dccf98
...
@@ -955,6 +955,14 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
...
@@ -955,6 +955,14 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
return
system
.
load_item
(
location
,
for_parent
=
for_parent
)
return
system
.
load_item
(
location
,
for_parent
=
for_parent
)
@property
def
disabled_xblock_types
(
self
):
return
self
.
_disabled_xblock_types
@disabled_xblock_types.setter
def
disabled_xblock_types
(
self
,
value
):
self
.
_disabled_xblock_types
=
value
def
_load_items
(
self
,
course_key
,
items
,
depth
=
0
,
using_descriptor_system
=
None
,
for_parent
=
None
):
def
_load_items
(
self
,
course_key
,
items
,
depth
=
0
,
using_descriptor_system
=
None
,
for_parent
=
None
):
"""
"""
Load a list of xmodules from the data in items, with children cached up
Load a list of xmodules from the data in items, with children cached up
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
99dccf98
...
@@ -3348,10 +3348,18 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -3348,10 +3348,18 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
render_template
=
self
.
render_template
,
render_template
=
self
.
render_template
,
mixins
=
self
.
xblock_mixins
,
mixins
=
self
.
xblock_mixins
,
select
=
self
.
xblock_select
,
select
=
self
.
xblock_select
,
disabled_xblock_types
=
self
.
disabled_xblock_types
,
disabled_xblock_types
=
self
.
_
disabled_xblock_types
,
services
=
self
.
services
,
services
=
self
.
services
,
)
)
@property
def
disabled_xblock_types
(
self
):
return
self
.
_disabled_xblock_types
@disabled_xblock_types.setter
def
disabled_xblock_types
(
self
,
value
):
self
.
_disabled_xblock_types
=
value
def
ensure_indexes
(
self
):
def
ensure_indexes
(
self
):
"""
"""
Ensure that all appropriate indexes are created that are needed by this modulestore, or raise
Ensure that all appropriate indexes are created that are needed by this modulestore, or raise
...
...
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