Get Studio deprecation list from XBlockConfiguration.
Replaces settings value. TNL-4669
This commit is contained in:
@@ -91,6 +91,7 @@ from util.organizations_helpers import (
|
||||
organizations_enabled,
|
||||
)
|
||||
from util.string_utils import _has_non_ascii_characters
|
||||
from xblock_django.api import deprecated_xblocks
|
||||
from xmodule.contentstore.content import StaticContent
|
||||
from xmodule.course_module import CourseFields
|
||||
from xmodule.course_module import DEFAULT_START_DATE
|
||||
@@ -599,7 +600,8 @@ def course_index(request, course_key):
|
||||
except (ItemNotFoundError, CourseActionStateItemNotFoundError):
|
||||
current_action = None
|
||||
|
||||
deprecated_blocks_info = _deprecated_blocks_info(course_module, settings.DEPRECATED_BLOCK_TYPES)
|
||||
deprecated_block_names = [block.name for block in deprecated_xblocks()]
|
||||
deprecated_blocks_info = _deprecated_blocks_info(course_module, deprecated_block_names)
|
||||
|
||||
return render_to_response('course_outline.html', {
|
||||
'context_course': course_module,
|
||||
|
||||
@@ -470,37 +470,24 @@ class TestCourseOutline(CourseTestCase):
|
||||
)
|
||||
|
||||
@ddt.data(
|
||||
{'publish': True},
|
||||
{'publish': False},
|
||||
[{'publish': True}, ['notes']],
|
||||
[{'publish': False}, ['notes']],
|
||||
[{'publish': True}, ['notes', 'lti']]
|
||||
)
|
||||
@ddt.unpack
|
||||
def test_verify_deprecated_warning_message_with_single_feature(self, publish):
|
||||
def test_verify_deprecated_warning_message(self, publish, block_types):
|
||||
"""
|
||||
Verify deprecated warning info for single deprecated feature.
|
||||
Verify deprecated warning info.
|
||||
"""
|
||||
block_types = ['notes']
|
||||
with override_settings(DEPRECATED_BLOCK_TYPES=block_types):
|
||||
course_module = modulestore().get_item(self.course.location)
|
||||
self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish)
|
||||
info = _deprecated_blocks_info(course_module, block_types)
|
||||
self._verify_deprecated_info(
|
||||
course_module.id,
|
||||
course_module.advanced_modules,
|
||||
info,
|
||||
block_types
|
||||
)
|
||||
|
||||
def test_verify_deprecated_warning_message_with_multiple_features(self):
|
||||
"""
|
||||
Verify deprecated warning info for multiple deprecated features.
|
||||
"""
|
||||
block_types = ['notes', 'lti']
|
||||
with override_settings(DEPRECATED_BLOCK_TYPES=block_types):
|
||||
course_module = modulestore().get_item(self.course.location)
|
||||
self._create_test_data(course_module, create_blocks=True, block_types=block_types)
|
||||
|
||||
info = _deprecated_blocks_info(course_module, block_types)
|
||||
self._verify_deprecated_info(course_module.id, course_module.advanced_modules, info, block_types)
|
||||
course_module = modulestore().get_item(self.course.location)
|
||||
self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish)
|
||||
info = _deprecated_blocks_info(course_module, block_types)
|
||||
self._verify_deprecated_info(
|
||||
course_module.id,
|
||||
course_module.advanced_modules,
|
||||
info,
|
||||
block_types
|
||||
)
|
||||
|
||||
@ddt.data(
|
||||
{'delete_vertical': True},
|
||||
|
||||
@@ -103,9 +103,5 @@
|
||||
"THEME_NAME": "",
|
||||
"TIME_ZONE": "America/New_York",
|
||||
"WIKI_ENABLED": true,
|
||||
"OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2",
|
||||
"DEPRECATED_BLOCK_TYPES": [
|
||||
"poll",
|
||||
"survey"
|
||||
]
|
||||
"OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2"
|
||||
}
|
||||
|
||||
@@ -96,9 +96,6 @@ FEATURES['ENABLE_VIDEO_BUMPER'] = True # Enable video bumper in Studio settings
|
||||
# Enable partner support link in Studio footer
|
||||
PARTNER_SUPPORT_EMAIL = 'partner-support@example.com'
|
||||
|
||||
# Disable some block types to test block deprecation logic
|
||||
DEPRECATED_BLOCK_TYPES = ['poll', 'survey']
|
||||
|
||||
########################### Entrance Exams #################################
|
||||
FEATURES['ENTRANCE_EXAMS'] = True
|
||||
|
||||
|
||||
@@ -1131,18 +1131,6 @@ XBLOCK_SETTINGS = {
|
||||
|
||||
# The following settings are used for deprecating XBlocks.
|
||||
|
||||
# Adding an XBlock to this list does the following:
|
||||
# 1. Shows a warning on the course outline if the XBlock is listed in
|
||||
# "Advanced Module List" in "Advanced Settings" page.
|
||||
# 2. List all instances of that XBlock on the top of the course outline page asking
|
||||
# course authors to delete or replace the instances.
|
||||
DEPRECATED_BLOCK_TYPES = [
|
||||
'peergrading',
|
||||
'combinedopenended',
|
||||
'graphical_slider_tool',
|
||||
'randomize',
|
||||
]
|
||||
|
||||
# Adding components in this list will disable the creation of new problems for
|
||||
# those advanced components in Studio. Existing problems will work fine
|
||||
# and one can edit them in Studio.
|
||||
|
||||
Reference in New Issue
Block a user