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
e65909a6
Commit
e65909a6
authored
Feb 15, 2017
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add XBlockDisableConfig model back so migrations are in sync again.
parent
b37e53e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
common/djangoapps/xblock_django/models.py
+37
-0
No files found.
common/djangoapps/xblock_django/models.py
View file @
e65909a6
...
...
@@ -8,6 +8,43 @@ from django.utils.translation import ugettext_lazy as _
from
config_models.models
import
ConfigurationModel
class
XBlockDisableConfig
(
ConfigurationModel
):
"""
Configuration for disabling and deprecating XBlocks.
"""
class
Meta
(
ConfigurationModel
.
Meta
):
app_label
=
'xblock_django'
disabled_blocks
=
TextField
(
default
=
''
,
blank
=
True
,
help_text
=
_
(
'Space-separated list of XBlocks which should not render.'
)
)
disabled_create_blocks
=
TextField
(
default
=
''
,
blank
=
True
,
help_text
=
_
(
"Space-separated list of XBlock types whose creation to disable in Studio."
)
)
@classmethod
def
is_block_type_disabled
(
cls
,
block_type
):
""" Return True if block_type is disabled. """
config
=
cls
.
current
()
if
not
config
.
enabled
:
return
False
return
block_type
in
config
.
disabled_blocks
.
split
()
def
__unicode__
(
self
):
config
=
XBlockDisableConfig
.
current
()
return
u"Disabled xblocks = {disabled_xblocks}"
.
format
(
disabled_xblocks
=
config
.
disabled_blocks
)
class
XBlockConfiguration
(
ConfigurationModel
):
"""
XBlock configuration used by both LMS and Studio, and not specific to a particular template.
...
...
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