Update schema for bok-choy database
Finalize tests for embargo middleware app
This commit is contained in:
committed by
Sarina Canelake
parent
e71bbeb1e2
commit
1fe453a3a7
@@ -78,6 +78,9 @@ FEATURES = {
|
||||
|
||||
# Allow editing of short description in course settings in cms
|
||||
'EDITABLE_SHORT_DESCRIPTION': True,
|
||||
|
||||
# Toggles embargo functionality
|
||||
'EMBARGO': False,
|
||||
}
|
||||
ENABLE_JASMINE = False
|
||||
|
||||
|
||||
@@ -190,3 +190,6 @@ FEATURES['ENABLE_SERVICE_STATUS'] = True
|
||||
|
||||
# This is to disable a test under the common directory that will not pass when run under CMS
|
||||
FEATURES['DISABLE_RESET_EMAIL_TEST'] = True
|
||||
|
||||
# Toggles embargo on for testing
|
||||
FEATURES['EMBARGO'] = True
|
||||
|
||||
@@ -15,14 +15,15 @@ class EmbargoedCourseAdmin(admin.ModelAdmin):
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': ('course_id', 'embargoed'),
|
||||
'description': textwrap.dedent("""Enter a course id in the following box.
|
||||
Do not enter leading or trailing slashes. There is no need to surround the
|
||||
course ID with quotes.
|
||||
Validation will be performed on the course name, and if it is invalid, an
|
||||
error message will display.
|
||||
'description': textwrap.dedent("""\
|
||||
Enter a course id in the following box.
|
||||
Do not enter leading or trailing slashes. There is no need to surround the
|
||||
course ID with quotes.
|
||||
Validation will be performed on the course name, and if it is invalid, an
|
||||
error message will display.
|
||||
|
||||
To enable embargos against this course (restrict course access from embargoed
|
||||
states), check the "Embargoed" box, then click "Save".
|
||||
To enable embargos against this course (restrict course access from embargoed
|
||||
states), check the "Embargoed" box, then click "Save".
|
||||
""")
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -9,9 +9,7 @@ from embargo.fixtures.country_codes import COUNTRY_CODES
|
||||
|
||||
import socket
|
||||
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError, InvalidLocationError
|
||||
|
||||
|
||||
class EmbargoedCourseForm(forms.ModelForm): # pylint: disable=incomplete-protocol
|
||||
@@ -23,18 +21,17 @@ class EmbargoedCourseForm(forms.ModelForm): # pylint: disable=incomplete-protoc
|
||||
def clean_course_id(self):
|
||||
"""Validate the course id"""
|
||||
course_id = self.cleaned_data["course_id"]
|
||||
|
||||
# Try to get the course. If this returns None, it's not a real course
|
||||
try:
|
||||
# Try to get the course descriptor, if we can do that,
|
||||
# it's a real course.
|
||||
course_loc = CourseDescriptor.id_to_location(course_id)
|
||||
modulestore().get_instance(course_id, course_loc, depth=1)
|
||||
except (KeyError, ItemNotFoundError):
|
||||
course = modulestore().get_course(course_id)
|
||||
except ValueError:
|
||||
msg = 'COURSE NOT FOUND'
|
||||
msg += u' --- Entered course id was: "{0}". '.format(course_id)
|
||||
msg += 'Please recheck that you have supplied a valid course id.'
|
||||
raise forms.ValidationError(msg)
|
||||
except (ValueError, InvalidLocationError):
|
||||
msg = 'INVALID LOCATION'
|
||||
if not course:
|
||||
msg = 'COURSE NOT FOUND'
|
||||
msg += u' --- Entered course id was: "{0}". '.format(course_id)
|
||||
msg += 'Please recheck that you have supplied a valid course id.'
|
||||
raise forms.ValidationError(msg)
|
||||
@@ -50,14 +47,12 @@ class EmbargoedStateForm(forms.ModelForm): # pylint: disable=incomplete-protoco
|
||||
|
||||
def _is_valid_code(self, code):
|
||||
"""Whether or not code is a valid country code"""
|
||||
if code in COUNTRY_CODES:
|
||||
return True
|
||||
return False
|
||||
return code in COUNTRY_CODES
|
||||
|
||||
def clean_embargoed_countries(self):
|
||||
"""Validate the country list"""
|
||||
embargoed_countries = self.cleaned_data["embargoed_countries"]
|
||||
if embargoed_countries == '':
|
||||
if not embargoed_countries:
|
||||
return ''
|
||||
|
||||
error_countries = []
|
||||
|
||||
@@ -9,8 +9,8 @@ HTTP_X_FORWARDED_FOR).
|
||||
"""
|
||||
|
||||
import pygeoip
|
||||
import django.core.exceptions
|
||||
|
||||
from django.core.exceptions import MiddlewareNotUsed
|
||||
from django.conf import settings
|
||||
from django.shortcuts import redirect
|
||||
from ipware.ip import get_ip
|
||||
@@ -29,7 +29,7 @@ class EmbargoMiddleware(object):
|
||||
def __init__(self):
|
||||
# If embargoing is turned off, make this middleware do nothing
|
||||
if not settings.FEATURES.get('EMBARGO', False):
|
||||
raise django.core.exceptions.MiddlewareNotUsed()
|
||||
raise MiddlewareNotUsed()
|
||||
|
||||
def process_request(self, request):
|
||||
"""
|
||||
|
||||
@@ -25,14 +25,6 @@ class EmbargoCourseFormTest(ModuleStoreTestCase):
|
||||
self.true_form_data = {'course_id': self.course.id, 'embargoed': True}
|
||||
self.false_form_data = {'course_id': self.course.id, 'embargoed': False}
|
||||
|
||||
def tearDown(self):
|
||||
# Delete any EmbargoedCourse record we may have created
|
||||
try:
|
||||
record = EmbargoedCourse.objects.get(course_id=self.course.id)
|
||||
record.delete()
|
||||
except EmbargoedCourse.DoesNotExist:
|
||||
return
|
||||
|
||||
def test_embargo_course(self):
|
||||
self.assertFalse(EmbargoedCourse.is_embargoed(self.course.id))
|
||||
# Test adding embargo to this course
|
||||
@@ -94,7 +86,7 @@ class EmbargoCourseFormTest(ModuleStoreTestCase):
|
||||
# Validation shouldn't work
|
||||
self.assertFalse(form.is_valid())
|
||||
|
||||
msg = 'INVALID LOCATION'
|
||||
msg = 'COURSE NOT FOUND'
|
||||
msg += u' --- Entered course id was: "{0}". '.format(bad_id)
|
||||
msg += 'Please recheck that you have supplied a valid course id.'
|
||||
self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access
|
||||
@@ -106,6 +98,10 @@ class EmbargoCourseFormTest(ModuleStoreTestCase):
|
||||
class EmbargoedStateFormTest(TestCase):
|
||||
"""Test form for adding new states"""
|
||||
|
||||
def setUp(self):
|
||||
# Explicitly clear the cache, since ConfigurationModel relies on the cache
|
||||
cache.clear()
|
||||
|
||||
def tearDown(self):
|
||||
# Explicitly clear ConfigurationModel's cache so tests have a clear cache
|
||||
# and don't interfere with each other
|
||||
@@ -128,7 +124,6 @@ class EmbargoedStateFormTest(TestCase):
|
||||
form.save()
|
||||
self.assertTrue(len(EmbargoedState.current().embargoed_countries_list) == 0)
|
||||
|
||||
|
||||
def test_add_invalid_states(self):
|
||||
# test adding invalid codes
|
||||
# xx is not valid
|
||||
|
||||
@@ -45,10 +45,14 @@ class EmbargoMiddlewareTests(TestCase):
|
||||
# Text from lms/templates/static_templates/embargo.html
|
||||
self.embargo_text = "Unfortunately, at this time edX must comply with export controls, and we cannot allow you to access this particular course."
|
||||
|
||||
self.patcher = mock.patch.object(pygeoip.GeoIP, 'country_code_by_addr', self.mock_country_code_by_addr)
|
||||
self.patcher.start()
|
||||
|
||||
def tearDown(self):
|
||||
# Explicitly clear ConfigurationModel's cache so tests have a clear cache
|
||||
# and don't interfere with each other
|
||||
cache.clear()
|
||||
self.patcher.stop()
|
||||
|
||||
def mock_country_code_by_addr(self, ip_addr):
|
||||
"""
|
||||
@@ -65,32 +69,29 @@ class EmbargoMiddlewareTests(TestCase):
|
||||
|
||||
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
|
||||
def test_countries(self):
|
||||
with mock.patch.object(pygeoip.GeoIP, 'country_code_by_addr') as mocked_method:
|
||||
mocked_method.side_effect = self.mock_country_code_by_addr
|
||||
# Accessing an embargoed page from a blocked IP should cause a redirect
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 302)
|
||||
# Following the redirect should give us the embargo page
|
||||
response = self.client.get(
|
||||
self.embargoed_page,
|
||||
HTTP_X_FORWARDED_FOR='1.0.0.0',
|
||||
REMOTE_ADDR='1.0.0.0',
|
||||
follow=True
|
||||
)
|
||||
self.assertIn(self.embargo_text, response.content)
|
||||
|
||||
# Accessing an embargoed page from a blocked IP should cause a redirect
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 302)
|
||||
# Following the redirect should give us the embargo page
|
||||
response = self.client.get(
|
||||
self.embargoed_page,
|
||||
HTTP_X_FORWARDED_FOR='1.0.0.0',
|
||||
REMOTE_ADDR='1.0.0.0',
|
||||
follow=True
|
||||
)
|
||||
self.assertIn(self.embargo_text, response.content)
|
||||
# Accessing a regular page from a blocked IP should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular page from a blocked IP should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
# Accessing an embargoed page from a non-embargoed IP should succeed
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing an embargoed page from a non-embargoed IP should succeed
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular page from a non-embargoed IP should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
# Accessing a regular page from a non-embargoed IP should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
|
||||
def test_ip_exceptions(self):
|
||||
@@ -102,31 +103,57 @@ class EmbargoMiddlewareTests(TestCase):
|
||||
enabled=True
|
||||
).save()
|
||||
|
||||
with mock.patch.object(pygeoip.GeoIP, 'country_code_by_addr') as mocked_method:
|
||||
mocked_method.side_effect = self.mock_country_code_by_addr
|
||||
# Accessing an embargoed page from a blocked IP that's been whitelisted
|
||||
# should succeed
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing an embargoed page from a blocked IP that's been whitelisted
|
||||
# should succeed
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
# Accessing a regular course from a blocked IP that's been whitelisted should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular course from a blocked IP that's been whitelisted should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
# Accessing an embargoed course from non-embargoed IP that's been blacklisted
|
||||
# should cause a redirect
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 302)
|
||||
# Following the redirect should give us the embargo page
|
||||
response = self.client.get(
|
||||
self.embargoed_page,
|
||||
HTTP_X_FORWARDED_FOR='5.0.0.0',
|
||||
REMOTE_ADDR='1.0.0.0',
|
||||
follow=True
|
||||
)
|
||||
self.assertIn(self.embargo_text, response.content)
|
||||
|
||||
# Accessing an embargoed course from non-embargoed IP that's been blacklisted
|
||||
# should cause a redirect
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 302)
|
||||
# Following the redirect should give us the embargo page
|
||||
response = self.client.get(
|
||||
self.embargoed_page,
|
||||
HTTP_X_FORWARDED_FOR='5.0.0.0',
|
||||
REMOTE_ADDR='1.0.0.0',
|
||||
follow=True
|
||||
)
|
||||
self.assertIn(self.embargo_text, response.content)
|
||||
# Accessing a regular course from a non-embargoed IP that's been blacklisted should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular course from a non-embargoed IP that's been blacklisted should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
|
||||
@mock.patch.dict(settings.FEATURES, {'EMBARGO': False})
|
||||
def test_countries_embargo_off(self):
|
||||
# When the middleware is turned off, all requests should go through
|
||||
# Accessing an embargoed page from a blocked IP OK
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular page from a blocked IP should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='1.0.0.0', REMOTE_ADDR='1.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Explicitly whitelist/blacklist some IPs
|
||||
IPFilter(
|
||||
whitelist='1.0.0.0',
|
||||
blacklist='5.0.0.0',
|
||||
changed_by=self.user,
|
||||
enabled=True
|
||||
).save()
|
||||
|
||||
# Accessing an embargoed course from non-embargoed IP that's been blacklisted
|
||||
# should be OK
|
||||
response = self.client.get(self.embargoed_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Accessing a regular course from a non-embargoed IP that's been blacklisted should succeed
|
||||
response = self.client.get(self.regular_page, HTTP_X_FORWARDED_FOR='5.0.0.0', REMOTE_ADDR='5.0.0.0')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -46,7 +46,7 @@ CREATE TABLE `auth_permission` (
|
||||
UNIQUE KEY `content_type_id` (`content_type_id`,`codename`),
|
||||
KEY `auth_permission_e4470c6e` (`content_type_id`),
|
||||
CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=238 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=259 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `auth_registration`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
@@ -122,12 +122,14 @@ CREATE TABLE `auth_userprofile` (
|
||||
`location` varchar(255) NOT NULL,
|
||||
`meta` longtext NOT NULL,
|
||||
`courseware` varchar(255) NOT NULL,
|
||||
`gender` varchar(6) DEFAULT NULL,
|
||||
`gender` varchar(6),
|
||||
`mailing_address` longtext,
|
||||
`year_of_birth` int(11) DEFAULT NULL,
|
||||
`level_of_education` varchar(6) DEFAULT NULL,
|
||||
`year_of_birth` int(11),
|
||||
`level_of_education` varchar(6),
|
||||
`goals` longtext,
|
||||
`allow_certificate` tinyint(1) NOT NULL,
|
||||
`country` varchar(2),
|
||||
`city` longtext,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `user_id` (`user_id`),
|
||||
KEY `auth_userprofile_52094d6e` (`name`),
|
||||
@@ -147,6 +149,7 @@ CREATE TABLE `bulk_email_courseauthorization` (
|
||||
`course_id` varchar(255) NOT NULL,
|
||||
`email_enabled` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `bulk_email_courseauthorization_course_id_4f6cee675bf93275_uniq` (`course_id`),
|
||||
KEY `bulk_email_courseauthorization_ff48d8e5` (`course_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -187,7 +190,7 @@ DROP TABLE IF EXISTS `bulk_email_optout`;
|
||||
CREATE TABLE `bulk_email_optout` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`course_id` varchar(255) NOT NULL,
|
||||
`user_id` int(11) DEFAULT NULL,
|
||||
`user_id` int(11),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `bulk_email_optout_course_id_368f7519b2997e1a_uniq` (`course_id`,`user_id`),
|
||||
KEY `bulk_email_optout_ff48d8e5` (`course_id`),
|
||||
@@ -366,7 +369,7 @@ CREATE TABLE `courseware_studentmodule` (
|
||||
`grade` double DEFAULT NULL,
|
||||
`created` datetime NOT NULL,
|
||||
`modified` datetime NOT NULL,
|
||||
`max_grade` double DEFAULT NULL,
|
||||
`max_grade` double,
|
||||
`done` varchar(8) NOT NULL,
|
||||
`course_id` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
@@ -388,7 +391,7 @@ DROP TABLE IF EXISTS `courseware_studentmodulehistory`;
|
||||
CREATE TABLE `courseware_studentmodulehistory` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`student_module_id` int(11) NOT NULL,
|
||||
`version` varchar(255) DEFAULT NULL,
|
||||
`version` varchar(255),
|
||||
`created` datetime NOT NULL,
|
||||
`state` longtext,
|
||||
`grade` double DEFAULT NULL,
|
||||
@@ -458,6 +461,20 @@ CREATE TABLE `courseware_xmoduleuserstatesummaryfield` (
|
||||
KEY `courseware_xmodulecontentfield_5436e97a` (`modified`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `dark_lang_darklangconfig`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `dark_lang_darklangconfig` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`change_date` datetime NOT NULL,
|
||||
`changed_by_id` int(11) DEFAULT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
`released_languages` longtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `dark_lang_darklangconfig_16905482` (`changed_by_id`),
|
||||
CONSTRAINT `changed_by_id_refs_id_3fb19c355c5fe834` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `django_admin_log`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
@@ -536,7 +553,7 @@ CREATE TABLE `django_content_type` (
|
||||
`model` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `app_label` (`app_label`,`model`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `django_openid_auth_association`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
@@ -644,8 +661,8 @@ CREATE TABLE `djcelery_periodictask` (
|
||||
UNIQUE KEY `name` (`name`),
|
||||
KEY `djcelery_periodictask_17d2d99d` (`interval_id`),
|
||||
KEY `djcelery_periodictask_7aa5fda` (`crontab_id`),
|
||||
CONSTRAINT `interval_id_refs_id_f2054349` FOREIGN KEY (`interval_id`) REFERENCES `djcelery_intervalschedule` (`id`),
|
||||
CONSTRAINT `crontab_id_refs_id_ebff5e74` FOREIGN KEY (`crontab_id`) REFERENCES `djcelery_crontabschedule` (`id`)
|
||||
CONSTRAINT `crontab_id_refs_id_ebff5e74` FOREIGN KEY (`crontab_id`) REFERENCES `djcelery_crontabschedule` (`id`),
|
||||
CONSTRAINT `interval_id_refs_id_f2054349` FOREIGN KEY (`interval_id`) REFERENCES `djcelery_intervalschedule` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `djcelery_periodictasks`;
|
||||
@@ -698,6 +715,46 @@ CREATE TABLE `djcelery_workerstate` (
|
||||
KEY `djcelery_workerstate_eb8ac7e4` (`last_heartbeat`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `embargo_embargoedcourse`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `embargo_embargoedcourse` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`course_id` varchar(255) NOT NULL,
|
||||
`embargoed` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `course_id` (`course_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `embargo_embargoedstate`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `embargo_embargoedstate` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`change_date` datetime NOT NULL,
|
||||
`changed_by_id` int(11) DEFAULT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
`embargoed_countries` longtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `embargo_embargoedstate_16905482` (`changed_by_id`),
|
||||
CONSTRAINT `changed_by_id_refs_id_3c8b83add0205d39` 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 `embargo_ipfilter`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `embargo_ipfilter` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`change_date` datetime NOT NULL,
|
||||
`changed_by_id` int(11) DEFAULT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
`whitelist` longtext NOT NULL,
|
||||
`blacklist` longtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `embargo_ipfilter_16905482` (`changed_by_id`),
|
||||
CONSTRAINT `changed_by_id_refs_id_3babbf0a22c1f5d3` 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 `external_auth_externalauthmap`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
@@ -933,6 +990,18 @@ CREATE TABLE `psychometrics_psychometricdata` (
|
||||
UNIQUE KEY `studentmodule_id` (`studentmodule_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `reverification_midcoursereverificationwindow`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `reverification_midcoursereverificationwindow` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`course_id` varchar(255) NOT NULL,
|
||||
`start_date` datetime DEFAULT NULL,
|
||||
`end_date` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `reverification_midcoursereverificationwindow_ff48d8e5` (`course_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `shoppingcart_certificateitem`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
@@ -969,7 +1038,7 @@ CREATE TABLE `shoppingcart_order` (
|
||||
`bill_to_ccnum` varchar(8) NOT NULL,
|
||||
`bill_to_cardtype` varchar(32) NOT NULL,
|
||||
`processor_reply_dump` longtext NOT NULL,
|
||||
`refunded_time` datetime DEFAULT NULL,
|
||||
`refunded_time` datetime,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `shoppingcart_order_fbfc09f1` (`user_id`),
|
||||
CONSTRAINT `user_id_refs_id_a4b0342e1195673` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
|
||||
@@ -987,9 +1056,9 @@ CREATE TABLE `shoppingcart_orderitem` (
|
||||
`unit_cost` decimal(30,2) NOT NULL,
|
||||
`line_desc` varchar(1024) NOT NULL,
|
||||
`currency` varchar(8) NOT NULL,
|
||||
`fulfilled_time` datetime DEFAULT NULL,
|
||||
`fulfilled_time` datetime,
|
||||
`report_comments` longtext NOT NULL,
|
||||
`refund_requested_time` datetime DEFAULT NULL,
|
||||
`refund_requested_time` datetime,
|
||||
`service_fee` decimal(30,2) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `shoppingcart_orderitem_8337030b` (`order_id`),
|
||||
@@ -1034,7 +1103,25 @@ CREATE TABLE `south_migrationhistory` (
|
||||
`migration` varchar(255) NOT NULL,
|
||||
`applied` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `splash_splashconfig`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `splash_splashconfig` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`change_date` datetime NOT NULL,
|
||||
`changed_by_id` int(11) DEFAULT NULL,
|
||||
`enabled` tinyint(1) NOT NULL,
|
||||
`cookie_name` longtext NOT NULL,
|
||||
`cookie_allowed_values` longtext NOT NULL,
|
||||
`unaffected_usernames` longtext NOT NULL,
|
||||
`redirect_url` varchar(200) NOT NULL,
|
||||
`unaffected_url_paths` longtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `splash_splashconfig_16905482` (`changed_by_id`),
|
||||
CONSTRAINT `changed_by_id_refs_id_6024c0b79125b21c` 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 `student_anonymoususerid`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
@@ -1085,6 +1172,19 @@ CREATE TABLE `student_courseenrollmentallowed` (
|
||||
KEY `student_courseenrollmentallowed_3216ff68` (`created`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `student_loginfailures`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `student_loginfailures` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`failure_count` int(11) NOT NULL,
|
||||
`lockout_until` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `student_loginfailures_fbfc09f1` (`user_id`),
|
||||
CONSTRAINT `user_id_refs_id_50dcb1c1e6a71045` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `student_pendingemailchange`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
@@ -1167,7 +1267,7 @@ CREATE TABLE `track_trackinglog` (
|
||||
`event_type` varchar(512) NOT NULL,
|
||||
`event` longtext NOT NULL,
|
||||
`agent` varchar(256) NOT NULL,
|
||||
`page` varchar(512) DEFAULT NULL,
|
||||
`page` varchar(512),
|
||||
`time` datetime NOT NULL,
|
||||
`host` varchar(64) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
@@ -1208,6 +1308,8 @@ CREATE TABLE `verify_student_softwaresecurephotoverification` (
|
||||
`error_msg` longtext NOT NULL,
|
||||
`error_code` varchar(50) NOT NULL,
|
||||
`photo_id_key` longtext NOT NULL,
|
||||
`window_id` int(11),
|
||||
`display` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `verify_student_softwaresecurephotoverification_fbfc09f1` (`user_id`),
|
||||
KEY `verify_student_softwaresecurephotoverification_8713c555` (`receipt_id`),
|
||||
@@ -1215,8 +1317,11 @@ CREATE TABLE `verify_student_softwaresecurephotoverification` (
|
||||
KEY `verify_student_softwaresecurephotoverification_f84f7de6` (`updated_at`),
|
||||
KEY `verify_student_softwaresecurephotoverification_4452d192` (`submitted_at`),
|
||||
KEY `verify_student_softwaresecurephotoverification_b2c165b4` (`reviewing_user_id`),
|
||||
KEY `verify_student_softwaresecurephotoverification_7343ffda` (`window_id`),
|
||||
KEY `verify_student_softwaresecurephotoverification_35eebcb6` (`display`),
|
||||
CONSTRAINT `reviewing_user_id_refs_id_5b90d52ad6ea4207` FOREIGN KEY (`reviewing_user_id`) REFERENCES `auth_user` (`id`),
|
||||
CONSTRAINT `user_id_refs_id_5b90d52ad6ea4207` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
|
||||
CONSTRAINT `user_id_refs_id_5b90d52ad6ea4207` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`),
|
||||
CONSTRAINT `window_id_refs_id_30f70c30fce8f38a` FOREIGN KEY (`window_id`) REFERENCES `reverification_midcoursereverificationwindow` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `waffle_flag`;
|
||||
@@ -1448,9 +1553,9 @@ DROP TABLE IF EXISTS `wiki_imagerevision`;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `wiki_imagerevision` (
|
||||
`revisionpluginrevision_ptr_id` int(11) NOT NULL,
|
||||
`image` varchar(2000) DEFAULT NULL,
|
||||
`width` smallint(6) DEFAULT NULL,
|
||||
`height` smallint(6) DEFAULT NULL,
|
||||
`image` varchar(2000),
|
||||
`width` smallint(6),
|
||||
`height` smallint(6),
|
||||
PRIMARY KEY (`revisionpluginrevision_ptr_id`),
|
||||
CONSTRAINT `revisionpluginrevision_ptr_id_refs_id_5da3ee545b9fc791` FOREIGN KEY (`revisionpluginrevision_ptr_id`) REFERENCES `wiki_revisionpluginrevision` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -1484,7 +1589,7 @@ DROP TABLE IF EXISTS `wiki_revisionplugin`;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `wiki_revisionplugin` (
|
||||
`articleplugin_ptr_id` int(11) NOT NULL,
|
||||
`current_revision_id` int(11) DEFAULT NULL,
|
||||
`current_revision_id` int(11),
|
||||
PRIMARY KEY (`articleplugin_ptr_id`),
|
||||
UNIQUE KEY `current_revision_id` (`current_revision_id`),
|
||||
CONSTRAINT `current_revision_id_refs_id_2732d4b244938e26` FOREIGN KEY (`current_revision_id`) REFERENCES `wiki_revisionpluginrevision` (`id`),
|
||||
|
||||
@@ -218,6 +218,9 @@ FEATURES = {
|
||||
|
||||
# Turn off account locking if failed login attempts exceeds a limit
|
||||
'ENABLE_MAX_FAILED_LOGIN_ATTEMPTS': False,
|
||||
|
||||
# Toggle embargo functionality
|
||||
'EMBARGO': False,
|
||||
}
|
||||
|
||||
# Used for A/B testing
|
||||
|
||||
@@ -40,6 +40,9 @@ FEATURES['ENABLE_SHOPPING_CART'] = True
|
||||
FEATURES['ENABLE_S3_GRADE_DOWNLOADS'] = True
|
||||
FEATURES['ALLOW_COURSE_STAFF_GRADE_DOWNLOADS'] = True
|
||||
|
||||
# Toggles embargo on for testing
|
||||
FEATURES['EMBARGO'] = True
|
||||
|
||||
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
|
||||
WIKI_ENABLED = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user