Commit b8cd96e3 by cahrens

Delete XBlockDisableConfig model.

TNL-4672
parent 8acd1bb1
...@@ -5,14 +5,11 @@ Django admin dashboard configuration. ...@@ -5,14 +5,11 @@ Django admin dashboard configuration.
from django.contrib import admin from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin
from xblock_django.models import ( from xblock_django.models import (
XBlockDisableConfig, XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
) )
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
admin.site.register(XBlockDisableConfig, ConfigurationModelAdmin)
class XBlockConfigurationAdmin(KeyedConfigurationModelAdmin): class XBlockConfigurationAdmin(KeyedConfigurationModelAdmin):
""" """
Admin for XBlockConfiguration. Admin for XBlockConfiguration.
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('xblock_django', '0003_add_new_config_models'),
]
operations = [
migrations.RemoveField(
model_name='xblockdisableconfig',
name='changed_by',
),
migrations.DeleteModel(
name='XBlockDisableConfig',
),
]
...@@ -11,43 +11,6 @@ from django.db import models ...@@ -11,43 +11,6 @@ from django.db import models
from config_models.models import ConfigurationModel 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): class XBlockConfiguration(ConfigurationModel):
""" """
XBlock configuration used by both LMS and Studio, and not specific to a particular template. XBlock configuration used by both LMS and Studio, and not specific to a particular template.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -809,6 +809,21 @@ CREATE TABLE `bulk_email_target` ( ...@@ -809,6 +809,21 @@ CREATE TABLE `bulk_email_target` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `catalog_catalogintegration`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_catalogintegration` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`change_date` datetime(6) NOT NULL,
`enabled` tinyint(1) NOT NULL,
`internal_api_url` varchar(200) NOT NULL,
`cache_ttl` int(10) unsigned NOT NULL,
`changed_by_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `catalog_catalogin_changed_by_id_4c786efa531d484b_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `catalog_catalogin_changed_by_id_4c786efa531d484b_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ccx_ccxfieldoverride`; DROP TABLE IF EXISTS `ccx_ccxfieldoverride`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
...@@ -1914,7 +1929,7 @@ CREATE TABLE `django_migrations` ( ...@@ -1914,7 +1929,7 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL, `applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=172 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `django_openid_auth_association`; DROP TABLE IF EXISTS `django_openid_auth_association`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
...@@ -2188,6 +2203,7 @@ CREATE TABLE `email_marketing_emailmarketingconfiguration` ( ...@@ -2188,6 +2203,7 @@ CREATE TABLE `email_marketing_emailmarketingconfiguration` (
`sailthru_get_tags_from_sailthru` tinyint(1) NOT NULL, `sailthru_get_tags_from_sailthru` tinyint(1) NOT NULL,
`sailthru_purchase_template` varchar(20) NOT NULL, `sailthru_purchase_template` varchar(20) NOT NULL,
`sailthru_upgrade_template` varchar(20) NOT NULL, `sailthru_upgrade_template` varchar(20) NOT NULL,
`sailthru_lms_url_override` varchar(80) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `email_marketing_e_changed_by_id_1c6968b921f23b0b_fk_auth_user_id` (`changed_by_id`), KEY `email_marketing_e_changed_by_id_1c6968b921f23b0b_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `email_marketing_e_changed_by_id_1c6968b921f23b0b_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`) CONSTRAINT `email_marketing_e_changed_by_id_1c6968b921f23b0b_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
...@@ -4655,7 +4671,7 @@ CREATE TABLE `wiki_articlerevision` ( ...@@ -4655,7 +4671,7 @@ CREATE TABLE `wiki_articlerevision` (
`revision_number` int(11) NOT NULL, `revision_number` int(11) NOT NULL,
`user_message` longtext NOT NULL, `user_message` longtext NOT NULL,
`automatic_log` longtext NOT NULL, `automatic_log` longtext NOT NULL,
`ip_address` char(15) DEFAULT NULL, `ip_address` char(39) DEFAULT NULL,
`modified` datetime(6) NOT NULL, `modified` datetime(6) NOT NULL,
`created` datetime(6) NOT NULL, `created` datetime(6) NOT NULL,
`deleted` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL,
...@@ -4695,7 +4711,7 @@ CREATE TABLE `wiki_attachmentrevision` ( ...@@ -4695,7 +4711,7 @@ CREATE TABLE `wiki_attachmentrevision` (
`revision_number` int(11) NOT NULL, `revision_number` int(11) NOT NULL,
`user_message` longtext NOT NULL, `user_message` longtext NOT NULL,
`automatic_log` longtext NOT NULL, `automatic_log` longtext NOT NULL,
`ip_address` char(15) DEFAULT NULL, `ip_address` char(39) DEFAULT NULL,
`modified` datetime(6) NOT NULL, `modified` datetime(6) NOT NULL,
`created` datetime(6) NOT NULL, `created` datetime(6) NOT NULL,
`deleted` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL,
...@@ -4778,7 +4794,7 @@ CREATE TABLE `wiki_revisionpluginrevision` ( ...@@ -4778,7 +4794,7 @@ CREATE TABLE `wiki_revisionpluginrevision` (
`revision_number` int(11) NOT NULL, `revision_number` int(11) NOT NULL,
`user_message` longtext NOT NULL, `user_message` longtext NOT NULL,
`automatic_log` longtext NOT NULL, `automatic_log` longtext NOT NULL,
`ip_address` char(15) DEFAULT NULL, `ip_address` char(39) DEFAULT NULL,
`modified` datetime(6) NOT NULL, `modified` datetime(6) NOT NULL,
`created` datetime(6) NOT NULL, `created` datetime(6) NOT NULL,
`deleted` tinyint(1) NOT NULL, `deleted` tinyint(1) NOT NULL,
...@@ -4915,21 +4931,6 @@ CREATE TABLE `xblock_django_xblockconfiguration` ( ...@@ -4915,21 +4931,6 @@ CREATE TABLE `xblock_django_xblockconfiguration` (
CONSTRAINT `xblock_django_xbl_changed_by_id_61068ae9f50d6490_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`) CONSTRAINT `xblock_django_xbl_changed_by_id_61068ae9f50d6490_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `xblock_django_xblockdisableconfig`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `xblock_django_xblockdisableconfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`change_date` datetime(6) NOT NULL,
`enabled` tinyint(1) NOT NULL,
`disabled_blocks` longtext NOT NULL,
`changed_by_id` int(11) DEFAULT NULL,
`disabled_create_blocks` longtext NOT NULL,
PRIMARY KEY (`id`),
KEY `xblock_django_xbl_changed_by_id_429bdccb9201831c_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `xblock_django_xbl_changed_by_id_429bdccb9201831c_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `xblock_django_xblockstudioconfiguration`; DROP TABLE IF EXISTS `xblock_django_xblockstudioconfiguration`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
......
...@@ -35,7 +35,7 @@ CREATE TABLE `django_migrations` ( ...@@ -35,7 +35,7 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL, `applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=172 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment