diff --git a/cms/djangoapps/contentstore/__init__.py b/cms/djangoapps/contentstore/__init__.py index d3060371e5..e69de29bb2 100644 --- a/cms/djangoapps/contentstore/__init__.py +++ b/cms/djangoapps/contentstore/__init__.py @@ -1,2 +0,0 @@ -""" module init will register signal handlers """ -import contentstore.signals diff --git a/cms/djangoapps/contentstore/context_processors.py b/cms/djangoapps/contentstore/context_processors.py index 9d3131dd13..e9811c8be3 100644 --- a/cms/djangoapps/contentstore/context_processors.py +++ b/cms/djangoapps/contentstore/context_processors.py @@ -15,7 +15,7 @@ config.readfp(config_file) def doc_url(request=None): # pylint: disable=unused-argument """ - This function is added in the list of TEMPLATE_CONTEXT_PROCESSORS, which is a django setting for + This function is added in the list of TEMPLATES 'context_processors' OPTION, which is a django setting for a tuple of callables that take a request object as their argument and return a dictionary of items to be merged into the RequestContext. diff --git a/cms/djangoapps/contentstore/courseware_index.py b/cms/djangoapps/contentstore/courseware_index.py index 2a05caf64c..21cb2b2398 100644 --- a/cms/djangoapps/contentstore/courseware_index.py +++ b/cms/djangoapps/contentstore/courseware_index.py @@ -7,7 +7,7 @@ import re from six import add_metaclass from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy, ugettext as _ from django.core.urlresolvers import resolve from contentstore.utils import course_image_url @@ -350,7 +350,7 @@ class CoursewareSearchIndexer(SearchIndexerBase): 'category': 'courseware_index' } - UNNAMED_MODULE_NAME = _("(Unnamed)") + UNNAMED_MODULE_NAME = ugettext_lazy("(Unnamed)") @classmethod def normalize_structure_key(cls, structure_key): @@ -417,7 +417,7 @@ class CoursewareSearchIndexer(SearchIndexerBase): while parent is not None: path_component_name = parent.display_name if not path_component_name: - path_component_name = cls.UNNAMED_MODULE_NAME + path_component_name = unicode(cls.UNNAMED_MODULE_NAME) location_path.append(path_component_name) parent = parent.get_parent() location_path.reverse() diff --git a/cms/djangoapps/contentstore/management/commands/delete_orphans.py b/cms/djangoapps/contentstore/management/commands/delete_orphans.py index 202f8c2057..c0971bbc08 100644 --- a/cms/djangoapps/contentstore/management/commands/delete_orphans.py +++ b/cms/djangoapps/contentstore/management/commands/delete_orphans.py @@ -14,18 +14,19 @@ class Command(BaseCommand): |commit|: optional argument. If not provided, will not run task. ''' - def handle(self, *args, **options): - if len(args) not in {1, 2}: - raise CommandError("delete_orphans requires one or more arguments: |commit|") + def add_arguments(self, parser): + parser.add_argument('course_id') + parser.add_argument('--commit', action='store') + def handle(self, *args, **options): try: - course_key = CourseKey.from_string(args[0]) + course_key = CourseKey.from_string(options['course_id']) except InvalidKeyError: raise CommandError("Invalid course key.") commit = False - if len(args) == 2: - commit = args[1] == 'commit' + if options['commit']: + commit = options['commit'] == 'commit' if commit: print 'Deleting orphans from the course:' diff --git a/cms/djangoapps/contentstore/management/commands/export.py b/cms/djangoapps/contentstore/management/commands/export.py index 2aa2b0fdba..076bf944a2 100644 --- a/cms/djangoapps/contentstore/management/commands/export.py +++ b/cms/djangoapps/contentstore/management/commands/export.py @@ -18,23 +18,24 @@ class Command(BaseCommand): """ help = 'Export the specified data directory into the default ModuleStore' - def handle(self, *args, **options): - "Execute the command" - if len(args) != 2: - raise CommandError("export requires two arguments: ") + def add_arguments(self, parser): + parser.add_argument('course_id') + parser.add_argument('output_path') + def handle(self, *args, **options): + """Execute the command""" try: - course_key = CourseKey.from_string(args[0]) + course_key = CourseKey.from_string(options['course_id']) except InvalidKeyError: try: - course_key = SlashSeparatedCourseKey.from_deprecated_string(args[0]) + course_key = SlashSeparatedCourseKey.from_deprecated_string(options['course_id']) except InvalidKeyError: - raise CommandError("Invalid course_key: '%s'. " % args[0]) + raise CommandError("Invalid course_key: '%s'." % options['course_id']) if not modulestore().get_course(course_key): - raise CommandError("Course with %s key not found." % args[0]) + raise CommandError("Course with %s key not found." % options['course_id']) - output_path = args[1] + output_path = options['output_path'] print "Exporting course id = {0} to {1}".format(course_key, output_path) diff --git a/cms/djangoapps/contentstore/management/commands/fix_not_found.py b/cms/djangoapps/contentstore/management/commands/fix_not_found.py index 87e3406183..c31c4d446c 100644 --- a/cms/djangoapps/contentstore/management/commands/fix_not_found.py +++ b/cms/djangoapps/contentstore/management/commands/fix_not_found.py @@ -13,12 +13,14 @@ class Command(BaseCommand): """Fix a course's item not found errors""" help = "Fix a course's ItemNotFound errors" - def handle(self, *args, **options): - "Execute the command" - if len(args) != 1: - raise CommandError("requires 1 argument: ") + def add_arguments(self, parser): + parser.add_argument('course_id') - course_key = CourseKey.from_string(args[0]) + def handle(self, *args, **options): + """Execute the command""" + course_id = options.get('course_id', None) + + course_key = CourseKey.from_string(course_id) # for now only support on split mongo # pylint: disable=protected-access owning_store = modulestore()._get_modulestore_for_courselike(course_key) diff --git a/cms/djangoapps/contentstore/management/commands/import.py b/cms/djangoapps/contentstore/management/commands/import.py index 870d4eb722..9a9483cbc1 100644 --- a/cms/djangoapps/contentstore/management/commands/import.py +++ b/cms/djangoapps/contentstore/management/commands/import.py @@ -1,8 +1,9 @@ """ Script for importing courseware from XML format """ +from optparse import make_option -from django.core.management.base import BaseCommand, CommandError, make_option +from django.core.management.base import BaseCommand, CommandError from django_comment_common.utils import (seed_permissions_roles, are_permissions_roles_seeded) from xmodule.modulestore.xml_importer import import_course_from_xml diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py b/cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py index 9f38a85438..502cd7b49f 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py @@ -1,7 +1,7 @@ """Tests running the delete_orphan command""" import ddt -from django.core.management import call_command +from django.core.management import call_command, CommandError from contentstore.tests.test_orphan import TestOrphanBase from xmodule.modulestore.tests.factories import CourseFactory @@ -14,6 +14,13 @@ class TestDeleteOrphan(TestOrphanBase): Tests for running the delete_orphan management command. Inherits from TestOrphan in order to use its setUp method. """ + def test_no_args(self): + """ + Test delete_orphans command with no arguments + """ + with self.assertRaisesRegexp(CommandError, 'Error: too few arguments'): + call_command('delete_orphans') + @ddt.data(ModuleStoreEnum.Type.split, ModuleStoreEnum.Type.mongo) def test_delete_orphans_no_commit(self, default_store): """ @@ -35,7 +42,7 @@ class TestDeleteOrphan(TestOrphanBase): """ course = self.create_course_with_orphans(default_store) - call_command('delete_orphans', unicode(course.id), 'commit') + call_command('delete_orphans', unicode(course.id), commit='commit') # make sure this module wasn't deleted self.assertTrue(self.store.has_item(course.id.make_usage_key('html', 'multi_parent_html'))) @@ -59,7 +66,7 @@ class TestDeleteOrphan(TestOrphanBase): # call delete orphans, specifying the published branch # of the course - call_command('delete_orphans', unicode(published_branch), 'commit') + call_command('delete_orphans', unicode(published_branch), commit='commit') # now all orphans should be deleted self.assertOrphanCount(course.id, 0) diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_export.py b/cms/djangoapps/contentstore/management/commands/tests/test_export.py index 5ac8fb8d83..dcb8a208aa 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_export.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_export.py @@ -24,11 +24,9 @@ class TestArgParsingCourseExport(unittest.TestCase): """ Test export command with no arguments """ - errstring = "export requires two arguments: " - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, errstring): - call_command('export') - self.assertEqual(ex.exception.code, 1) + errstring = "Error: too few arguments" + with self.assertRaisesRegexp(CommandError, errstring): + call_command('export') @ddt.ddt @@ -59,11 +57,9 @@ class TestCourseExport(ModuleStoreTestCase): "Could not find course in {}".format(store) ) # Test `export` management command with invalid course_id - errstring = "Invalid course_key 'InvalidCourseID'." - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, errstring): - call_command('export', "InvalidCourseID", self.temp_dir_1) - self.assertEqual(ex.exception.code, 1) + errstring = "Invalid course_key: 'InvalidCourseID'." + with self.assertRaisesRegexp(CommandError, errstring): + call_command('export', "InvalidCourseID", self.temp_dir_1) # Test `export` management command with correct course_id for output_dir in [self.temp_dir_1, self.temp_dir_2]: @@ -74,7 +70,5 @@ class TestCourseExport(ModuleStoreTestCase): Test export command with a valid course key that doesn't exist """ errstring = "Course with x/y/z key not found." - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, errstring): - call_command('export', "x/y/z", self.temp_dir_1) - self.assertEqual(ex.exception.code, 1) + with self.assertRaisesRegexp(CommandError, errstring): + call_command('export', "x/y/z", self.temp_dir_1) diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py b/cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py index ceff802d46..dac5ad0393 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py @@ -2,7 +2,7 @@ Tests for the fix_not_found management command """ -from django.core.management import call_command +from django.core.management import CommandError, call_command from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory @@ -12,12 +12,19 @@ class TestFixNotFound(ModuleStoreTestCase): """ Tests for the fix_not_found management command """ + def test_no_args(self): + """ + Test fix_not_found command with no arguments + """ + with self.assertRaisesRegexp(CommandError, "Error: too few arguments"): + call_command('fix_not_found') + def test_fix_not_found_non_split(self): """ The management command doesn't work on non split courses """ course = CourseFactory.create(default_store=ModuleStoreEnum.Type.mongo) - with self.assertRaises(SystemExit): + with self.assertRaisesRegexp(CommandError, "The owning modulestore does not support this command."): call_command("fix_not_found", unicode(course.id)) def test_fix_not_found(self): diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py index 3b98c3db4a..a8dfe03cd0 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py @@ -56,57 +56,33 @@ class TestGitExport(CourseTestCase): Test that the command interface works. Ignore stderr for clean test output. """ - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, 'This script requires.*'): - call_command('git_export', 'blah', 'blah', 'blah', - stderr=StringIO.StringIO()) - self.assertEqual(ex.exception.code, 1) + with self.assertRaisesRegexp(CommandError, 'This script requires.*'): + call_command('git_export', 'blah', 'blah', 'blah', stderr=StringIO.StringIO()) - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, 'This script requires.*'): - call_command('git_export', stderr=StringIO.StringIO()) - self.assertEqual(ex.exception.code, 1) + with self.assertRaisesRegexp(CommandError, 'This script requires.*'): + call_command('git_export', stderr=StringIO.StringIO()) # Send bad url to get course not exported - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, unicode(GitExportError.URL_BAD)): - call_command('git_export', 'foo/bar/baz', 'silly', - stderr=StringIO.StringIO()) - self.assertEqual(ex.exception.code, 1) + with self.assertRaisesRegexp(CommandError, unicode(GitExportError.URL_BAD)): + call_command('git_export', 'foo/bar/baz', 'silly', stderr=StringIO.StringIO()) + # Send bad course_id to get course not exported - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, unicode(GitExportError.BAD_COURSE)): - call_command('git_export', 'foo/bar:baz', 'silly', - stderr=StringIO.StringIO()) - self.assertEqual(ex.exception.code, 1) + with self.assertRaisesRegexp(CommandError, unicode(GitExportError.BAD_COURSE)): + call_command('git_export', 'foo/bar:baz', 'silly', stderr=StringIO.StringIO()) def test_error_output(self): """ Verify that error output is actually resolved as the correct string """ - output = StringIO.StringIO() - with self.assertRaises(SystemExit): - with self.assertRaisesRegexp(CommandError, unicode(GitExportError.BAD_COURSE)): - call_command( - 'git_export', 'foo/bar:baz', 'silly', - stdout=output, stderr=output - ) - self.assertIn('Bad course location provided', output.getvalue()) - output.close() + with self.assertRaisesRegexp(CommandError, unicode(GitExportError.BAD_COURSE)): + call_command( + 'git_export', 'foo/bar:baz', 'silly' + ) - output = StringIO.StringIO() - with self.assertRaises(SystemExit): - with self.assertRaisesRegexp(CommandError, unicode(GitExportError.URL_BAD)): - call_command( - 'git_export', 'foo/bar/baz', 'silly', - stdout=output, stderr=output - ) - self.assertIn( - 'Non writable git url provided. Expecting something like:' - ' git@github.com:mitocw/edx4edx_lite.git', - output.getvalue() - ) - output.close() + with self.assertRaisesRegexp(CommandError, unicode(GitExportError.URL_BAD)): + call_command( + 'git_export', 'foo/bar/baz', 'silly' + ) def test_bad_git_url(self): """ diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py index 6383d046b8..71db8f4f07 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py @@ -6,7 +6,6 @@ import mock from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from common.test.utils import nostderr from xmodule.modulestore.tests.factories import CourseFactory, LibraryFactory from contentstore.management.commands.reindex_course import Command as ReindexCommand @@ -48,36 +47,30 @@ class TestReindexCourse(ModuleStoreTestCase): def test_given_no_arguments_raises_command_error(self): """ Test that raises CommandError for incorrect arguments """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments .*"): - call_command('reindex_course') + with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments.*"): + call_command('reindex_course') - @ddt.data('qwerty', 'invalid_key', 'xblock-v1:qwe+rty') + @ddt.data('qwerty', 'invalid_key', 'xblockv1:qwerty') def test_given_invalid_course_key_raises_not_found(self, invalid_key): """ Test that raises InvalidKeyError for invalid keys """ - errstring = "Invalid course_key: '%s'." % invalid_key - with self.assertRaises(SystemExit) as ex: - with self.assertRaisesRegexp(CommandError, errstring): - call_command('reindex_course', invalid_key) - self.assertEqual(ex.exception.code, 1) + err_string = "Invalid course_key: '{0}'".format(invalid_key) + with self.assertRaisesRegexp(CommandError, err_string): + call_command('reindex_course', invalid_key) def test_given_library_key_raises_command_error(self): """ Test that raises CommandError if library key is passed """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(SearchIndexingError, ".* is not a course key"): - call_command('reindex_course', unicode(self._get_lib_key(self.first_lib))) + with self.assertRaisesRegexp(CommandError, ".* is not a course key"): + call_command('reindex_course', unicode(self._get_lib_key(self.first_lib))) - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(SearchIndexingError, ".* is not a course key"): - call_command('reindex_course', unicode(self._get_lib_key(self.second_lib))) + with self.assertRaisesRegexp(CommandError, ".* is not a course key"): + call_command('reindex_course', unicode(self._get_lib_key(self.second_lib))) - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(SearchIndexingError, ".* is not a course key"): - call_command( - 'reindex_course', - unicode(self.second_course.id), - unicode(self._get_lib_key(self.first_lib)) - ) + with self.assertRaisesRegexp(CommandError, ".* is not a course key"): + call_command( + 'reindex_course', + unicode(self.second_course.id), + unicode(self._get_lib_key(self.first_lib)) + ) def test_given_id_list_indexes_courses(self): """ Test that reindexes courses when given single course key or a list of course keys """ diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py index 0fab7f28e1..d44b8a3886 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py @@ -6,7 +6,6 @@ import mock from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from common.test.utils import nostderr from xmodule.modulestore.tests.factories import CourseFactory, LibraryFactory from opaque_keys import InvalidKeyError @@ -50,9 +49,8 @@ class TestReindexLibrary(ModuleStoreTestCase): def test_given_no_arguments_raises_command_error(self): """ Test that raises CommandError for incorrect arguments """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments .*"): - call_command('reindex_library') + with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments.*"): + call_command('reindex_library') @ddt.data('qwerty', 'invalid_key', 'xblock-v1:qwe+rty') def test_given_invalid_lib_key_raises_not_found(self, invalid_key): @@ -62,21 +60,18 @@ class TestReindexLibrary(ModuleStoreTestCase): def test_given_course_key_raises_command_error(self): """ Test that raises CommandError if course key is passed """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* is not a library key"): - call_command('reindex_library', unicode(self.first_course.id)) + with self.assertRaisesRegexp(CommandError, ".* is not a library key"): + call_command('reindex_library', unicode(self.first_course.id)) - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* is not a library key"): - call_command('reindex_library', unicode(self.second_course.id)) + with self.assertRaisesRegexp(CommandError, ".* is not a library key"): + call_command('reindex_library', unicode(self.second_course.id)) - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* is not a library key"): - call_command( - 'reindex_library', - unicode(self.second_course.id), - unicode(self._get_lib_key(self.first_lib)) - ) + with self.assertRaisesRegexp(CommandError, ".* is not a library key"): + call_command( + 'reindex_library', + unicode(self.second_course.id), + unicode(self._get_lib_key(self.first_lib)) + ) def test_given_id_list_indexes_libraries(self): """ Test that reindexes libraries when given single library key or a list of library keys """ diff --git a/cms/djangoapps/contentstore/migrations/0001_initial.py b/cms/djangoapps/contentstore/migrations/0001_initial.py index e824bac7d0..88126406e3 100644 --- a/cms/djangoapps/contentstore/migrations/0001_initial.py +++ b/cms/djangoapps/contentstore/migrations/0001_initial.py @@ -1,80 +1,43 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'VideoUploadConfig' - db.create_table('contentstore_videouploadconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('profile_whitelist', self.gf('django.db.models.fields.TextField')(blank=True)), - ('status_whitelist', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('contentstore', ['VideoUploadConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - if not db.dry_run: - orm.VideoUploadConfig.objects.create( - profile_whitelist="desktop_mp4,desktop_webm,mobile_low,youtube", - status_whitelist="Uploading,In Progress,Complete,Failed,Invalid Token,Unknown" - ) - - def backwards(self, orm): - # Deleting model 'VideoUploadConfig' - db.delete_table('contentstore_videouploadconfig') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contentstore.videouploadconfig': { - 'Meta': {'object_name': 'VideoUploadConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'profile_whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'status_whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['contentstore'] + operations = [ + migrations.CreateModel( + name='PushNotificationConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='VideoUploadConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('profile_whitelist', models.TextField(help_text=b'A comma-separated list of names of profiles to include in video encoding downloads.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/cms/djangoapps/contentstore/migrations/0002_auto__del_field_videouploadconfig_status_whitelist.py b/cms/djangoapps/contentstore/migrations/0002_auto__del_field_videouploadconfig_status_whitelist.py deleted file mode 100644 index e5fce94d8b..0000000000 --- a/cms/djangoapps/contentstore/migrations/0002_auto__del_field_videouploadconfig_status_whitelist.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'VideoUploadConfig.status_whitelist' - db.delete_column('contentstore_videouploadconfig', 'status_whitelist') - - - def backwards(self, orm): - # Adding field 'VideoUploadConfig.status_whitelist' - db.add_column('contentstore_videouploadconfig', 'status_whitelist', - self.gf('django.db.models.fields.TextField')(default='', blank=True), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contentstore.videouploadconfig': { - 'Meta': {'object_name': 'VideoUploadConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'profile_whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['contentstore'] \ No newline at end of file diff --git a/cms/djangoapps/contentstore/migrations/0003_auto__add_pushnotificationconfig.py b/cms/djangoapps/contentstore/migrations/0003_auto__add_pushnotificationconfig.py deleted file mode 100644 index 7963916271..0000000000 --- a/cms/djangoapps/contentstore/migrations/0003_auto__add_pushnotificationconfig.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'PushNotificationConfig' - db.create_table('contentstore_pushnotificationconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('contentstore', ['PushNotificationConfig']) - - - def backwards(self, orm): - # Deleting model 'PushNotificationConfig' - db.delete_table('contentstore_pushnotificationconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contentstore.pushnotificationconfig': { - 'Meta': {'object_name': 'PushNotificationConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contentstore.videouploadconfig': { - 'Meta': {'object_name': 'VideoUploadConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'profile_whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['contentstore'] \ No newline at end of file diff --git a/cms/djangoapps/contentstore/startup.py b/cms/djangoapps/contentstore/startup.py new file mode 100644 index 0000000000..a19773bb37 --- /dev/null +++ b/cms/djangoapps/contentstore/startup.py @@ -0,0 +1,2 @@ +""" will register signal handlers, moved out of __init__.py to ensure correct loading order post Django 1.7 """ +from . import signals # pylint: disable=unused-import diff --git a/cms/djangoapps/contentstore/views/entrance_exam.py b/cms/djangoapps/contentstore/views/entrance_exam.py index aaf311ba4f..400ce362d3 100644 --- a/cms/djangoapps/contentstore/views/entrance_exam.py +++ b/cms/djangoapps/contentstore/views/entrance_exam.py @@ -187,7 +187,7 @@ def _get_entrance_exam(request, course_key): # pylint: disable=W0613 exam_descriptor = modulestore().get_item(exam_key) return HttpResponse( escape_json_dumps({'locator': unicode(exam_descriptor.location)}), - status=200, mimetype='application/json') + status=200, content_type='application/json') except ItemNotFoundError: return HttpResponse(status=404) diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 0eddbcb9eb..e0f5537bde 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -301,7 +301,7 @@ def xblock_view_handler(request, usage_key_string, view_name): hashed_resources = OrderedDict() for resource in fragment.resources: - hashed_resources[hash_resource(resource)] = resource + hashed_resources[hash_resource(resource)] = resource._asdict() return JsonResponse({ 'html': fragment.content, diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 6e5d6dc768..0bc31f41c0 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -38,7 +38,7 @@ from .session_kv_store import SessionKeyValueStore from .helpers import render_from_lms from contentstore.views.access import get_user_role -from cms.djangoapps.xblock_config.models import StudioConfig +from xblock_config.models import StudioConfig __all__ = ['preview_handler'] diff --git a/cms/djangoapps/contentstore/views/tests/test_course_index.py b/cms/djangoapps/contentstore/views/tests/test_course_index.py index 2cfeeb8e04..0d3e5932b2 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_index.py @@ -610,12 +610,12 @@ class TestCourseReIndex(CourseTestCase): response = non_staff_client.get(index_url, {}, HTTP_ACCEPT='application/json') self.assertEqual(response.status_code, 403) - def test_content_type_none(self): + def test_empty_content_type(self): """ - Test json content type is set if none is selected + Test json content type is set if '' is selected """ index_url = reverse_course_url('course_search_index_handler', self.course.id) - response = self.client.get(index_url, {}, CONTENT_TYPE=None) + response = self.client.get(index_url, {}, CONTENT_TYPE='') # A course with the default release date should display as "Unscheduled" self.assertIn(self.SUCCESSFUL_RESPONSE, response.content) diff --git a/cms/djangoapps/contentstore/views/tests/test_preview.py b/cms/djangoapps/contentstore/views/tests/test_preview.py index 107e5dc955..e7a34c0957 100644 --- a/cms/djangoapps/contentstore/views/tests/test_preview.py +++ b/cms/djangoapps/contentstore/views/tests/test_preview.py @@ -17,7 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from contentstore.views.preview import get_preview_fragment, _preview_module_system from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.test_asides import AsideTestType -from cms.djangoapps.xblock_config.models import StudioConfig +from xblock_config.models import StudioConfig from xmodule.modulestore.django import modulestore diff --git a/cms/djangoapps/course_creators/migrations/0001_initial.py b/cms/djangoapps/course_creators/migrations/0001_initial.py index a1d2c8d08a..14b68306c7 100644 --- a/cms/djangoapps/course_creators/migrations/0001_initial.py +++ b/cms/djangoapps/course_creators/migrations/0001_initial.py @@ -1,74 +1,25 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseCreator' - db.create_table('course_creators_coursecreator', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)), - ('state_changed', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('state', self.gf('django.db.models.fields.CharField')(default='unrequested', max_length=24)), - ('note', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)), - )) - db.send_create_signal('course_creators', ['CourseCreator']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'CourseCreator' - db.delete_table('course_creators_coursecreator') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_creators.coursecreator': { - 'Meta': {'object_name': 'CourseCreator'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'note': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'default': "'unrequested'", 'max_length': '24'}), - 'state_changed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - } - } - - complete_apps = ['course_creators'] + operations = [ + migrations.CreateModel( + name='CourseCreator', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('state_changed', models.DateTimeField(help_text='The date when state was last updated', verbose_name=b'state last updated', auto_now_add=True)), + ('state', models.CharField(default=b'unrequested', help_text='Current course creator state', max_length=24, choices=[(b'unrequested', 'unrequested'), (b'pending', 'pending'), (b'granted', 'granted'), (b'denied', 'denied')])), + ('note', models.CharField(help_text='Optional notes about this user (for example, why course creation access was denied)', max_length=512, blank=True)), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, help_text='Studio user')), + ], + ), + ] diff --git a/cms/djangoapps/course_creators/models.py b/cms/djangoapps/course_creators/models.py index 5138916c88..59d28b63e1 100644 --- a/cms/djangoapps/course_creators/models.py +++ b/cms/djangoapps/course_creators/models.py @@ -36,7 +36,7 @@ class CourseCreator(models.Model): (DENIED, _(u'denied')), ) - user = models.ForeignKey(User, help_text=_("Studio user"), unique=True) + user = models.OneToOneField(User, help_text=_("Studio user")) state_changed = models.DateTimeField('state last updated', auto_now_add=True, help_text=_("The date when state was last updated")) state = models.CharField(max_length=24, blank=False, choices=STATES, default=UNREQUESTED, diff --git a/cms/djangoapps/course_creators/tests/test_admin.py b/cms/djangoapps/course_creators/tests/test_admin.py index 059dbc3cb6..45d84eed62 100644 --- a/cms/djangoapps/course_creators/tests/test_admin.py +++ b/cms/djangoapps/course_creators/tests/test_admin.py @@ -105,7 +105,7 @@ class CourseCreatorAdminTest(TestCase): # message sent. Admin message will follow. base_num_emails = 1 if expect_sent_to_user else 0 if expect_sent_to_admin: - context = {'user_name': "test_user", 'user_email': 'test_user+courses@edx.org'} + context = {'user_name': "test_user", 'user_email': u'test_user+courses@edx.org'} self.assertEquals(base_num_emails + 1, len(mail.outbox), 'Expected admin message to be sent') sent_mail = mail.outbox[base_num_emails] self.assertEquals( @@ -166,10 +166,10 @@ class CourseCreatorAdminTest(TestCase): # try logging in 30 times, the default limit in the number of failed # login attempts in one 5 minute period before the rate gets limited for _ in xrange(30): - response = self.client.post('/admin/', post_params) + response = self.client.post('/admin/login/', post_params) self.assertEquals(response.status_code, 200) - response = self.client.post('/admin/', post_params) + response = self.client.post('/admin/login/', post_params) # Since we are using the default rate limit behavior, we are # expecting this to return a 403 error to indicate that there have # been too many attempts diff --git a/cms/djangoapps/xblock_config/admin.py b/cms/djangoapps/xblock_config/admin.py index daad91a062..dc83781427 100644 --- a/cms/djangoapps/xblock_config/admin.py +++ b/cms/djangoapps/xblock_config/admin.py @@ -4,6 +4,6 @@ Django admin dashboard configuration for LMS XBlock infrastructure. from django.contrib import admin from config_models.admin import ConfigurationModelAdmin -from cms.djangoapps.xblock_config.models import StudioConfig +from xblock_config.models import StudioConfig admin.site.register(StudioConfig, ConfigurationModelAdmin) diff --git a/cms/djangoapps/xblock_config/migrations/0001_initial.py b/cms/djangoapps/xblock_config/migrations/0001_initial.py index c48d02bd57..8d3f9883cd 100644 --- a/cms/djangoapps/xblock_config/migrations/0001_initial.py +++ b/cms/djangoapps/xblock_config/migrations/0001_initial.py @@ -1,74 +1,30 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'StudioConfig' - db.create_table('xblock_config_studioconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('disabled_blocks', self.gf('django.db.models.fields.TextField')(default='about course_info static_tab')), - )) - db.send_create_signal('xblock_config', ['StudioConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'StudioConfig' - db.delete_table('xblock_config_studioconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'xblock_config.studioconfig': { - 'Meta': {'object_name': 'StudioConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'disabled_blocks': ('django.db.models.fields.TextField', [], {'default': "'about course_info static_tab'"}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['xblock_config'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='StudioConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('disabled_blocks', models.TextField(default=b'about course_info static_tab', help_text=b'Space-separated list of XBlocks on which XBlockAsides should never render in studio')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 92e5deca3e..20bdeb0270 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -79,6 +79,7 @@ DATABASES = { 'OPTIONS': { 'timeout': 30, }, + 'ATOMIC_REQUESTS': True, } } @@ -100,7 +101,7 @@ USE_I18N = True # Include the lettuce app for acceptance testing, including the 'harvest' django-admin command # django.contrib.staticfiles used to be loaded by lettuce, now we must add it ourselves # django.contrib.staticfiles is not added to lms as there is a ^/static$ route built in to the app -INSTALLED_APPS += ('lettuce.django', 'django.contrib.staticfiles') +INSTALLED_APPS += ('lettuce.django',) LETTUCE_APPS = ('contentstore',) LETTUCE_BROWSER = os.environ.get('LETTUCE_BROWSER', 'chrome') diff --git a/cms/envs/aws.py b/cms/envs/aws.py index e68d120d1d..44f1861b05 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -39,7 +39,6 @@ CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else "" ############### ALWAYS THE SAME ################################ DEBUG = False -TEMPLATE_DEBUG = False EMAIL_BACKEND = 'django_ses.SESBackend' SESSION_ENGINE = 'django.contrib.sessions.backends.cache' @@ -69,11 +68,6 @@ BROKER_HEARTBEAT_CHECKRATE = 2 # Each worker should only fetch one message at a time CELERYD_PREFETCH_MULTIPLIER = 1 -# Skip djcelery migrations, since we don't use the database as the broker -SOUTH_MIGRATION_MODULES = { - 'djcelery': 'ignore', -} - # Rename the exchange and queues for each variant QUEUE_VARIANT = CONFIG_PREFIX.lower() @@ -130,6 +124,12 @@ LMS_BASE = ENV_TOKENS.get('LMS_BASE') SITE_NAME = ENV_TOKENS['SITE_NAME'] +ALLOWED_HOSTS = [ + # TODO: bbeggs remove this before prod, temp fix to get load testing running + "*", + ENV_TOKENS.get('CMS_BASE') +] + LOG_DIR = ENV_TOKENS['LOG_DIR'] CACHES = ENV_TOKENS['CACHES'] @@ -249,6 +249,8 @@ EMAIL_HOST_PASSWORD = AUTH_TOKENS.get('EMAIL_HOST_PASSWORD', EMAIL_HOST_PASSWORD # Note that this is the Studio key for Segment. There is a separate key for the LMS. CMS_SEGMENT_KEY = AUTH_TOKENS.get('SEGMENT_KEY') +SECRET_KEY = AUTH_TOKENS['SECRET_KEY'] + AWS_ACCESS_KEY_ID = AUTH_TOKENS["AWS_ACCESS_KEY_ID"] if AWS_ACCESS_KEY_ID == "": AWS_ACCESS_KEY_ID = None @@ -265,6 +267,11 @@ else: DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' DATABASES = AUTH_TOKENS['DATABASES'] + +# Enable automatic transaction management on all databases +for database_name in DATABASES: + DATABASES[database_name]['ATOMIC_REQUESTS'] = True + MODULESTORE = convert_module_store_setting_if_needed(AUTH_TOKENS.get('MODULESTORE', MODULESTORE)) CONTENTSTORE = AUTH_TOKENS['CONTENTSTORE'] DOC_STORE_CONFIG = AUTH_TOKENS['DOC_STORE_CONFIG'] diff --git a/cms/envs/common.py b/cms/envs/common.py index a96f8c2367..63ae7caaa0 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -59,6 +59,11 @@ from xmodule.modulestore.edit_info import EditInfoMixin from xmodule.mixin import LicenseMixin ############################ FEATURE CONFIGURATION ############################# + + +# Dummy secret key for dev/test +SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd' + STUDIO_NAME = "Studio" STUDIO_SHORT_NAME = "Studio" FEATURES = { @@ -206,8 +211,9 @@ sys.path.append(COMMON_ROOT / 'djangoapps') GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoIP.dat" GEOIPV6_PATH = REPO_ROOT / "common/static/data/geoip/GeoIPv6.dat" -############################# WEB CONFIGURATION ############################# -# This is where we stick our compiled template files. +############################# TEMPLATE CONFIGURATION ############################# +# Mako templating +# TODO: Move the Mako templating into a different engine in TEMPLATES below. import tempfile MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_cms') MAKO_TEMPLATES = {} @@ -222,25 +228,44 @@ MAKO_TEMPLATES['main'] = [ for namespace, template_dirs in lms.envs.common.MAKO_TEMPLATES.iteritems(): MAKO_TEMPLATES['lms.' + namespace] = template_dirs -TEMPLATE_DIRS = MAKO_TEMPLATES['main'] +# Django templating +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + # Don't look for template source files inside installed applications. + 'APP_DIRS': False, + # Instead, look for template source files in these dirs. + 'DIRS': MAKO_TEMPLATES['main'], + # Options specific to this backend. + 'OPTIONS': { + 'loaders': ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + ), + 'context_processors': ( + 'django.template.context_processors.request', + 'django.template.context_processors.static', + 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.i18n', + 'django.contrib.auth.context_processors.auth', # this is required for admin + 'django.template.context_processors.csrf', + 'dealer.contrib.django.staff.context_processor', # access git revision + 'contentstore.context_processors.doc_url', + ), + # Change 'debug' in your environment settings files - not here. + 'debug': False + } + } +] +DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0] + +############################################################################## EDX_ROOT_URL = '' LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/signin' LOGIN_URL = EDX_ROOT_URL + '/signin' - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'django.core.context_processors.static', - 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.i18n', - 'django.contrib.auth.context_processors.auth', # this is required for admin - 'django.core.context_processors.csrf', - 'dealer.contrib.django.staff.context_processor', # access git revision - 'contentstore.context_processors.doc_url', -) - # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = ( 'ratelimitbackend.backends.RateLimitModelBackend', @@ -275,12 +300,6 @@ simplefilter('ignore') ################################# Middleware ################################### -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -) - MIDDLEWARE_CLASSES = ( 'request_cache.middleware.RequestCache', 'django.middleware.cache.UpdateCacheMiddleware', @@ -304,11 +323,8 @@ MIDDLEWARE_CLASSES = ( 'embargo.middleware.EmbargoMiddleware', # Detects user-requested locale from 'accept-language' header in http request - # TODO: Re-import the Django version once we upgrade to Django 1.8 [PLAT-671] - # 'django.middleware.locale.LocaleMiddleware', - 'django_locale.middleware.LocaleMiddleware', + 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.transaction.TransactionMiddleware', # needs to run after locale middleware (or anything that modifies the request context) 'edxmako.middleware.MakoMiddleware', @@ -383,11 +399,12 @@ MODULESTORE = { } ############################ DJANGO_BUILTINS ################################ -# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here +# Change DEBUG in your environment settings files, not here DEBUG = False -TEMPLATE_DEBUG = False SESSION_COOKIE_SECURE = False SESSION_SAVE_EVERY_REQUEST = False +SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' + # Site info SITE_ID = 1 @@ -704,8 +721,8 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', + 'django.contrib.staticfiles', 'djcelery', - 'south', 'method_override', # Common views @@ -726,13 +743,14 @@ INSTALLED_APPS = ( # For CMS 'contentstore', 'course_creators', + 'external_auth', 'student', # misleading name due to sharing with lms 'openedx.core.djangoapps.course_groups', # not used in cms (yet), but tests run 'xblock_config', # Tracking 'track', - 'eventtracking.django', + 'eventtracking.django.apps.EventTrackingConfig', # Monitoring 'datadog', @@ -740,7 +758,6 @@ INSTALLED_APPS = ( # For asset pipelining 'edxmako', 'pipeline', - 'django.contrib.staticfiles', 'static_replace', 'require', @@ -793,6 +810,11 @@ INSTALLED_APPS = ( # Self-paced course configuration 'openedx.core.djangoapps.self_paced', + + # These are apps that aren't strictly needed by Studio, but are imported by + # other apps that are. Django 1.8 wants to have imported models supported + # by installed apps. + 'lms.djangoapps.verify_student', ) @@ -901,9 +923,6 @@ OPTIONAL_APPS = ( # milestones 'milestones', - - # edX Proctoring - 'edx_proctoring', ) diff --git a/cms/envs/dev.py b/cms/envs/dev.py index ffd83d064a..8320a7b439 100644 --- a/cms/envs/dev.py +++ b/cms/envs/dev.py @@ -55,6 +55,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ENV_ROOT / "db" / "edx.db", + 'ATOMIC_REQUESTS': True, } } diff --git a/cms/envs/dev_with_worker.py b/cms/envs/dev_with_worker.py index 40f6ed4e1f..44145dad99 100644 --- a/cms/envs/dev_with_worker.py +++ b/cms/envs/dev_with_worker.py @@ -29,11 +29,5 @@ DJKOMBU_POLLING_INTERVAL = 1.0 # Disable transaction management because we are using a worker. Views # that request a task and wait for the result will deadlock otherwise. - -MIDDLEWARE_CLASSES = tuple( - c for c in MIDDLEWARE_CLASSES - if c != 'django.middleware.transaction.TransactionMiddleware') - -# Note: other alternatives for disabling transactions don't work in 1.4 -# https://code.djangoproject.com/ticket/2304 -# https://code.djangoproject.com/ticket/16039 +for database_name in DATABASES: + DATABASES[database_name]['ATOMIC_REQUESTS'] = False diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index eb951edc22..6634a202ff 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -12,7 +12,7 @@ MEDIA_ROOT = "/edx/var/edxapp/uploads" DEBUG = True USE_I18N = True -TEMPLATE_DEBUG = DEBUG +DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = DEBUG HTTPS = 'off' ################################ LOGGERS ###################################### diff --git a/cms/envs/test.py b/cms/envs/test.py index b96e0c02b3..186d34bb0c 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -128,9 +128,14 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': TEST_ROOT / "db" / "cms.db", + 'ATOMIC_REQUESTS': True, }, } +# This hack disables migrations during tests. We want to create tables directly from the models for speed. +# See https://groups.google.com/d/msg/django-developers/PWPj3etj3-U/kCl6pMsQYYoJ. +MIGRATION_MODULES = {app: "app.migrations_not_used_in_tests" for app in INSTALLED_APPS} + LMS_BASE = "localhost:8000" FEATURES['PREVIEW_LMS_BASE'] = "preview" @@ -171,11 +176,8 @@ CACHES = { }, } -# Add external_auth to Installed apps for testing -INSTALLED_APPS += ('external_auth', ) - -# Add milestones to Installed apps for testing -INSTALLED_APPS += ('milestones', 'openedx.core.djangoapps.call_stack_manager') +# Add apps to Installed apps for testing +INSTALLED_APPS += ('openedx.core.djangoapps.call_stack_manager',) # hide ratelimit warnings while running tests filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit') diff --git a/cms/envs/test_static_optimized.py b/cms/envs/test_static_optimized.py index 9b66e3cc45..c3efc3c83c 100644 --- a/cms/envs/test_static_optimized.py +++ b/cms/envs/test_static_optimized.py @@ -17,6 +17,7 @@ from .common import * # pylint: disable=wildcard-import, unused-wildcard-import DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', + 'ATOMIC_REQUESTS': True, }, } diff --git a/cms/envs/yaml_config.py b/cms/envs/yaml_config.py index dc6463f2b7..7b19b35670 100644 --- a/cms/envs/yaml_config.py +++ b/cms/envs/yaml_config.py @@ -85,11 +85,6 @@ BROKER_HEARTBEAT_CHECKRATE = 2 # Each worker should only fetch one message at a time CELERYD_PREFETCH_MULTIPLIER = 1 -# Skip djcelery migrations, since we don't use the database as the broker -SOUTH_MIGRATION_MODULES = { - 'djcelery': 'ignore', -} - # Rename the exchange and queues for each variant QUEUE_VARIANT = CONFIG_PREFIX.lower() diff --git a/cms/startup.py b/cms/startup.py index ca7d72dba3..da77a07ddb 100644 --- a/cms/startup.py +++ b/cms/startup.py @@ -8,7 +8,8 @@ from django.conf import settings settings.INSTALLED_APPS # pylint: disable=pointless-statement from openedx.core.lib.django_startup import autostartup -from monkey_patch import django_utils_translation +import django +from monkey_patch import third_party_auth import xmodule.x_module import cms.lib.xblock.runtime @@ -18,7 +19,9 @@ def run(): """ Executed during django startup """ - django_utils_translation.patch() + third_party_auth.patch() + + django.setup() autostartup() diff --git a/cms/templates/base.html b/cms/templates/base.html index 3feec0ad3c..6cd3eefd58 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -85,7 +85,7 @@ from openedx.core.lib.js_utils import ( url_name: "${context_course.location.name | h}", org: "${context_course.location.org | h}", num: "${context_course.location.course | h}", - display_course_number: "${_(context_course.display_coursenumber)}", + display_course_number: "${_(context_course.display_number_with_default)}", revision: "${context_course.location.revision | h}", self_paced: ${escape_json_dumps(context_course.self_paced) | n} }); diff --git a/common/djangoapps/auth_exchange/tests/test_views.py b/common/djangoapps/auth_exchange/tests/test_views.py index 7b7ca5a3a1..5c0b7503f9 100644 --- a/common/djangoapps/auth_exchange/tests/test_views.py +++ b/common/djangoapps/auth_exchange/tests/test_views.py @@ -130,14 +130,15 @@ class TestLoginWithAccessTokenView(TestCase): self.user = UserFactory() self.oauth2_client = Client.objects.create(client_type=provider.constants.CONFIDENTIAL) - def _verify_response(self, access_token, expected_status_code, expected_num_cookies): + def _verify_response(self, access_token, expected_status_code, expected_cookie_name=None): """ Calls the login_with_access_token endpoint and verifies the response given the expected values. """ url = reverse("login_with_access_token") response = self.client.post(url, HTTP_AUTHORIZATION="Bearer {0}".format(access_token)) self.assertEqual(response.status_code, expected_status_code) - self.assertEqual(len(response.cookies), expected_num_cookies) + if expected_cookie_name: + self.assertIn(expected_cookie_name, response.cookies) def test_success(self): access_token = AccessToken.objects.create( @@ -145,11 +146,9 @@ class TestLoginWithAccessTokenView(TestCase): client=self.oauth2_client, user=self.user, ) - self._verify_response(access_token, expected_status_code=204, expected_num_cookies=1) - self.assertEqual(len(self.client.cookies), 1) - self.assertEqual(self.client.session['_auth_user_id'], self.user.id) + self._verify_response(access_token, expected_status_code=204, expected_cookie_name='sessionid') + self.assertEqual(int(self.client.session['_auth_user_id']), self.user.id) def test_unauthenticated(self): - self._verify_response("invalid_token", expected_status_code=401, expected_num_cookies=0) - self.assertEqual(len(self.client.cookies), 0) + self._verify_response("invalid_token", expected_status_code=401) self.assertNotIn("session_key", self.client.session) diff --git a/common/djangoapps/cache_toolbox/core.py b/common/djangoapps/cache_toolbox/core.py index 6d3fac522b..31c853f7eb 100644 --- a/common/djangoapps/cache_toolbox/core.py +++ b/common/djangoapps/cache_toolbox/core.py @@ -33,8 +33,8 @@ def get_instance(model, instance_or_pk, timeout=None, using=None): >>> User.objects.get(pk=1) == get_instance(User, 1) True - """ + """ pk = getattr(instance_or_pk, 'pk', instance_or_pk) key = instance_key(model, instance_or_pk) data = cache.get(key) @@ -59,7 +59,7 @@ def get_instance(model, instance_or_pk, timeout=None, using=None): # fallback and return the underlying instance cache.delete(key) - # Use the default manager so we are never filtered by a .get_query_set() + # Use the default manager so we are never filtered by a .get_queryset() # import logging # log = logging.getLogger("tracking") @@ -94,7 +94,6 @@ def delete_instance(model, *instance_or_pk): """ Purges the cache keys for the instances of this model. """ - cache.delete_many([instance_key(model, x) for x in instance_or_pk]) @@ -102,10 +101,10 @@ def instance_key(model, instance_or_pk): """ Returns the cache key for this (model, instance) pair. """ - + # pylint: disable=protected-access return '%s.%s:%d' % ( model._meta.app_label, - model._meta.module_name, + model._meta.model_name, getattr(instance_or_pk, 'pk', instance_or_pk), ) diff --git a/common/djangoapps/config_models/admin.py b/common/djangoapps/config_models/admin.py index 90d79ec329..6003326936 100644 --- a/common/djangoapps/config_models/admin.py +++ b/common/djangoapps/config_models/admin.py @@ -5,14 +5,14 @@ Admin site models for managing :class:`.ConfigurationModel` subclasses from django.forms import models from django.contrib import admin from django.contrib.admin import ListFilter -from django.core.cache import get_cache, InvalidCacheBackendError +from django.core.cache import caches, InvalidCacheBackendError from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: - cache = get_cache('configuration') # pylint: disable=invalid-name + cache = caches['configuration'] # pylint: disable=invalid-name except InvalidCacheBackendError: from django.core.cache import cache @@ -84,7 +84,7 @@ class ConfigurationModelAdmin(admin.ModelAdmin): reverse( 'admin:{}_{}_change'.format( self.model._meta.app_label, - self.model._meta.module_name, + self.model._meta.model_name, ), args=(target.id,), ) @@ -142,7 +142,7 @@ class KeyedConfigurationModelAdmin(ConfigurationModelAdmin): date_hierarchy = None list_filter = (ShowHistoryFilter, ) - def queryset(self, request): + def get_queryset(self, request): """ Annote the queryset with an 'is_active' property that's true iff that row is the most recently added row for that particular set of KEY_FIELDS values. @@ -180,7 +180,7 @@ class KeyedConfigurationModelAdmin(ConfigurationModelAdmin): """ Edit link for the change view """ if not inst.is_active: return u'--' - update_url = reverse('admin:{}_{}_add'.format(self.model._meta.app_label, self.model._meta.module_name)) + update_url = reverse('admin:{}_{}_add'.format(self.model._meta.app_label, self.model._meta.model_name)) update_url += "?source={}".format(inst.pk) return u'{}'.format(update_url, _('Update')) edit_link.allow_tags = True diff --git a/common/djangoapps/config_models/models.py b/common/djangoapps/config_models/models.py index af3ac85984..5528f084cf 100644 --- a/common/djangoapps/config_models/models.py +++ b/common/djangoapps/config_models/models.py @@ -3,11 +3,11 @@ Django Model baseclass for database-backed configuration. """ from django.db import connection, models from django.contrib.auth.models import User -from django.core.cache import get_cache, InvalidCacheBackendError +from django.core.cache import caches, InvalidCacheBackendError from django.utils.translation import ugettext_lazy as _ try: - cache = get_cache('configuration') # pylint: disable=invalid-name + cache = caches['configuration'] # pylint: disable=invalid-name except InvalidCacheBackendError: from django.core.cache import cache @@ -37,7 +37,7 @@ class ConfigurationModelManager(models.Manager): necessaryily mean enbled. """ assert self.model.KEY_FIELDS != (), "Just use model.current() if there are no KEY_FIELDS" - return self.get_query_set().extra( + return self.get_queryset().extra( # pylint: disable=no-member where=["id IN ({subquery})".format(subquery=self._current_ids_subquery())], select={'is_active': 1}, # This annotation is used by the admin changelist. sqlite requires '1', not 'True' ) @@ -49,11 +49,11 @@ class ConfigurationModelManager(models.Manager): """ if self.model.KEY_FIELDS: subquery = self._current_ids_subquery() - return self.get_query_set().extra( + return self.get_queryset().extra( # pylint: disable=no-member select={'is_active': "id IN ({subquery})".format(subquery=subquery)} ) else: - return self.get_query_set().extra( + return self.get_queryset().extra( # pylint: disable=no-member select={'is_active': "id = {pk}".format(pk=self.model.current().pk)} ) diff --git a/common/djangoapps/config_models/views.py b/common/djangoapps/config_models/views.py index 2efcfa80bb..3bd693ec59 100644 --- a/common/djangoapps/config_models/views.py +++ b/common/djangoapps/config_models/views.py @@ -5,6 +5,7 @@ from rest_framework.generics import CreateAPIView, RetrieveAPIView from rest_framework.permissions import DjangoModelPermissions from rest_framework.authentication import SessionAuthentication from rest_framework.serializers import ModelSerializer +from django.db import transaction class ReadableOnlyByAuthors(DjangoModelPermissions): @@ -13,7 +14,29 @@ class ReadableOnlyByAuthors(DjangoModelPermissions): perms_map['GET'] = perms_map['OPTIONS'] = perms_map['HEAD'] = perms_map['POST'] -class ConfigurationModelCurrentAPIView(CreateAPIView, RetrieveAPIView): +class AtomicMixin(object): + """Mixin to provide atomic transaction for as_view.""" + @classmethod + def create_atomic_wrapper(cls, wrapped_func): + """Returns a wrapped function.""" + def _create_atomic_wrapper(*args, **kwargs): + """Actual wrapper.""" + # When a view call fails due to a permissions error, it raises an exception. + # An uncaught exception breaks the DB transaction for any following DB operations + # unless it's wrapped in a atomic() decorator or context manager. + with transaction.atomic(): + return wrapped_func(*args, **kwargs) + + return _create_atomic_wrapper + + @classmethod + def as_view(cls, **initkwargs): + """Overrides as_view to add atomic transaction.""" + view = super(AtomicMixin, cls).as_view(**initkwargs) + return cls.create_atomic_wrapper(view) + + +class ConfigurationModelCurrentAPIView(AtomicMixin, CreateAPIView, RetrieveAPIView): """ This view allows an authenticated user with the appropriate model permissions to read and write the current configuration for the specified `model`. diff --git a/common/djangoapps/cors_csrf/migrations/0001_initial.py b/common/djangoapps/cors_csrf/migrations/0001_initial.py index bdc4e752ca..f29fbb1d7e 100644 --- a/common/djangoapps/cors_csrf/migrations/0001_initial.py +++ b/common/djangoapps/cors_csrf/migrations/0001_initial.py @@ -1,74 +1,30 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'XDomainProxyConfiguration' - db.create_table('cors_csrf_xdomainproxyconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('whitelist', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('cors_csrf', ['XDomainProxyConfiguration']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'XDomainProxyConfiguration' - db.delete_table('cors_csrf_xdomainproxyconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'cors_csrf.xdomainproxyconfiguration': { - 'Meta': {'object_name': 'XDomainProxyConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {}) - } - } - - complete_apps = ['cors_csrf'] + operations = [ + migrations.CreateModel( + name='XDomainProxyConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('whitelist', models.TextField(help_text='List of domains that are allowed to make cross-domain requests to this site. Please list each domain on its own line.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/common/djangoapps/course_action_state/managers.py b/common/djangoapps/course_action_state/managers.py index 3bda32e501..6603e51678 100644 --- a/common/djangoapps/course_action_state/managers.py +++ b/common/djangoapps/course_action_state/managers.py @@ -55,7 +55,7 @@ class CourseActionUIStateManager(CourseActionStateManager): """ # add transaction protection to revert changes by get_or_create if an exception is raised before the final save. - @transaction.commit_on_success + @transaction.atomic def update_state( self, course_key, new_state, should_display=True, message="", user=None, allow_not_found=False, **kwargs ): diff --git a/common/djangoapps/course_action_state/migrations/0001_initial.py b/common/djangoapps/course_action_state/migrations/0001_initial.py index a8ab6c7db3..c95f5f8688 100644 --- a/common/djangoapps/course_action_state/migrations/0001_initial.py +++ b/common/djangoapps/course_action_state/migrations/0001_initial.py @@ -1,92 +1,38 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseRerunState' - db.create_table('course_action_state_coursererunstate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created_time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('updated_time', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - ('created_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='created_by_user+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - ('updated_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='updated_by_user+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('action', self.gf('django.db.models.fields.CharField')(max_length=100, db_index=True)), - ('state', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('should_display', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('message', self.gf('django.db.models.fields.CharField')(max_length=1000)), - ('source_course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - )) - db.send_create_signal('course_action_state', ['CourseRerunState']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding unique constraint on 'CourseRerunState', fields ['course_key', 'action'] - db.create_unique('course_action_state_coursererunstate', ['course_key', 'action']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseRerunState', fields ['course_key', 'action'] - db.delete_unique('course_action_state_coursererunstate', ['course_key', 'action']) - - # Deleting model 'CourseRerunState' - db.delete_table('course_action_state_coursererunstate') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_action_state.coursererunstate': { - 'Meta': {'unique_together': "(('course_key', 'action'),)", 'object_name': 'CourseRerunState'}, - 'action': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.CharField', [], {'max_length': '1000'}), - 'should_display': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'source_course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'updated_time': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'updated_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'updated_by_user+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['course_action_state'] + operations = [ + migrations.CreateModel( + name='CourseRerunState', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created_time', models.DateTimeField(auto_now_add=True)), + ('updated_time', models.DateTimeField(auto_now=True)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('action', models.CharField(max_length=100, db_index=True)), + ('state', models.CharField(max_length=50)), + ('should_display', models.BooleanField(default=False)), + ('message', models.CharField(max_length=1000)), + ('source_course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('display_name', models.CharField(default=b'', max_length=255, blank=True)), + ('created_user', models.ForeignKey(related_name='created_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ('updated_user', models.ForeignKey(related_name='updated_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ], + ), + migrations.AlterUniqueTogether( + name='coursererunstate', + unique_together=set([('course_key', 'action')]), + ), + ] diff --git a/common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py b/common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py deleted file mode 100644 index 92b2cc24a0..0000000000 --- a/common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseRerunState.display_name' - db.add_column('course_action_state_coursererunstate', 'display_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseRerunState.display_name' - db.delete_column('course_action_state_coursererunstate', 'display_name') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_action_state.coursererunstate': { - 'Meta': {'unique_together': "(('course_key', 'action'),)", 'object_name': 'CourseRerunState'}, - 'action': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.CharField', [], {'max_length': '1000'}), - 'should_display': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'source_course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'updated_time': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'updated_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'updated_by_user+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['course_action_state'] diff --git a/common/djangoapps/course_action_state/models.py b/common/djangoapps/course_action_state/models.py index 87fceebed7..6c2985018a 100644 --- a/common/djangoapps/course_action_state/models.py +++ b/common/djangoapps/course_action_state/models.py @@ -90,7 +90,7 @@ class CourseActionUIState(CourseActionState): # FIELDS # Whether or not the status should be displayed to users - should_display = models.BooleanField() + should_display = models.BooleanField(default=False) # Message related to the status message = models.CharField(max_length=MAX_MESSAGE_LENGTH) diff --git a/common/djangoapps/course_modes/admin.py b/common/djangoapps/course_modes/admin.py index f6c22551cd..6781227f5c 100644 --- a/common/djangoapps/course_modes/admin.py +++ b/common/djangoapps/course_modes/admin.py @@ -26,13 +26,14 @@ from course_modes.models import CourseMode # The admin page will work in both LMS and Studio, # but the test suite for Studio will fail because # the verification deadline table won't exist. -from verify_student import models as verification_models # pylint: disable=import-error +from lms.djangoapps.verify_student import models as verification_models class CourseModeForm(forms.ModelForm): class Meta(object): model = CourseMode + fields = '__all__' COURSE_MODE_SLUG_CHOICES = ( [(CourseMode.DEFAULT_MODE_SLUG, CourseMode.DEFAULT_MODE_SLUG)] + diff --git a/common/djangoapps/course_modes/migrations/0001_initial.py b/common/djangoapps/course_modes/migrations/0001_initial.py index 1818b8abea..a16a22cb8d 100644 --- a/common/djangoapps/course_modes/migrations/0001_initial.py +++ b/common/djangoapps/course_modes/migrations/0001_initial.py @@ -1,40 +1,48 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseMode' - db.create_table('course_modes_coursemode', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('mode_slug', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('mode_display_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('min_price', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('suggested_prices', self.gf('django.db.models.fields.CommaSeparatedIntegerField')(default='', max_length=255, blank=True)), - )) - db.send_create_signal('course_modes', ['CourseMode']) + dependencies = [ + ] - - def backwards(self, orm): - # Deleting model 'CourseMode' - db.delete_table('course_modes_coursemode') - - - models = { - 'course_modes.coursemode': { - 'Meta': {'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] + operations = [ + migrations.CreateModel( + name='CourseMode', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, verbose_name='Course', db_index=True)), + ('mode_slug', models.CharField(max_length=100, verbose_name='Mode')), + ('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')), + ('min_price', models.IntegerField(default=0, verbose_name='Price')), + ('currency', models.CharField(default=b'usd', max_length=8)), + ('expiration_datetime', models.DateTimeField(default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline', blank=True)), + ('expiration_date', models.DateField(default=None, null=True, blank=True)), + ('suggested_prices', models.CommaSeparatedIntegerField(default=b'', max_length=255, blank=True)), + ('description', models.TextField(null=True, blank=True)), + ('sku', models.CharField(help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=b'SKU', blank=True)), + ], + ), + migrations.CreateModel( + name='CourseModesArchive', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('mode_slug', models.CharField(max_length=100)), + ('mode_display_name', models.CharField(max_length=255)), + ('min_price', models.IntegerField(default=0)), + ('suggested_prices', models.CommaSeparatedIntegerField(default=b'', max_length=255, blank=True)), + ('currency', models.CharField(default=b'usd', max_length=8)), + ('expiration_date', models.DateField(default=None, null=True, blank=True)), + ('expiration_datetime', models.DateTimeField(default=None, null=True, blank=True)), + ], + ), + migrations.AlterUniqueTogether( + name='coursemode', + unique_together=set([('course_id', 'mode_slug', 'currency')]), + ), + ] diff --git a/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py b/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py deleted file mode 100644 index 78bb5bf4fa..0000000000 --- a/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseMode.currency' - db.add_column('course_modes_coursemode', 'currency', - self.gf('django.db.models.fields.CharField')(default='usd', max_length=8), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseMode.currency' - db.delete_column('course_modes_coursemode', 'currency') - - - models = { - 'course_modes.coursemode': { - 'Meta': {'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py b/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py deleted file mode 100644 index 7e6bc1bd40..0000000000 --- a/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding unique constraint on 'CourseMode', fields ['course_id', 'currency', 'mode_slug'] - db.create_unique('course_modes_coursemode', ['course_id', 'currency', 'mode_slug']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseMode', fields ['course_id', 'currency', 'mode_slug'] - db.delete_unique('course_modes_coursemode', ['course_id', 'currency', 'mode_slug']) - - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py b/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py deleted file mode 100644 index 19851446c4..0000000000 --- a/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseMode.expiration_date' - db.add_column('course_modes_coursemode', 'expiration_date', - self.gf('django.db.models.fields.DateField')(default=None, null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseMode.expiration_date' - db.delete_column('course_modes_coursemode', 'expiration_date') - - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py b/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py deleted file mode 100644 index 101c3b919b..0000000000 --- a/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseMode.expiration_datetime' - db.add_column('course_modes_coursemode', 'expiration_datetime', - self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseMode.expiration_datetime' - db.delete_column('course_modes_coursemode', 'expiration_datetime') - - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0006_expiration_date_to_datetime.py b/common/djangoapps/course_modes/migrations/0006_expiration_date_to_datetime.py deleted file mode 100644 index 319c1b02b8..0000000000 --- a/common/djangoapps/course_modes/migrations/0006_expiration_date_to_datetime.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - from datetime import datetime - for course_mode in orm.CourseMode.objects.all(): - if course_mode.expiration_date is None: - course_mode.expiration_datetime = None - course_mode.save() - else: - course_mode.expiration_datetime = datetime.combine(course_mode.expiration_date, datetime.min.time()) - course_mode.save() - - def backwards(self, orm): - for course_mode in orm.CourseMode.objects.all(): - course_mode.expiration_datetime = None - course_mode.save() - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] - symmetrical = True diff --git a/common/djangoapps/course_modes/migrations/0007_add_description.py b/common/djangoapps/course_modes/migrations/0007_add_description.py deleted file mode 100644 index 98386e4bcf..0000000000 --- a/common/djangoapps/course_modes/migrations/0007_add_description.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseMode.description' - db.add_column('course_modes_coursemode', 'description', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - - # Changing field 'CourseMode.course_id' - db.alter_column('course_modes_coursemode', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - def backwards(self, orm): - # Deleting field 'CourseMode.description' - db.delete_column('course_modes_coursemode', 'description') - - - # Changing field 'CourseMode.course_id' - db.alter_column('course_modes_coursemode', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py b/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py deleted file mode 100644 index 678f2c63be..0000000000 --- a/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseModesArchive' - db.create_table('course_modes_coursemodesarchive', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('mode_slug', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('mode_display_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('min_price', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('suggested_prices', self.gf('django.db.models.fields.CommaSeparatedIntegerField')(default='', max_length=255, blank=True)), - ('currency', self.gf('django.db.models.fields.CharField')(default='usd', max_length=8)), - ('expiration_date', self.gf('django.db.models.fields.DateField')(default=None, null=True, blank=True)), - ('expiration_datetime', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)), - )) - db.send_create_signal('course_modes', ['CourseModesArchive']) - - - # Changing field 'CourseMode.course_id' - db.alter_column('course_modes_coursemode', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - def backwards(self, orm): - # Deleting model 'CourseModesArchive' - db.delete_table('course_modes_coursemodesarchive') - - - # Changing field 'CourseMode.course_id' - db.alter_column('course_modes_coursemode', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - }, - 'course_modes.coursemodesarchive': { - 'Meta': {'object_name': 'CourseModesArchive'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s.py b/common/djangoapps/course_modes/migrations/0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s.py deleted file mode 100644 index c096f6c6bc..0000000000 --- a/common/djangoapps/course_modes/migrations/0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseMode.sku' - db.add_column('course_modes_coursemode', 'sku', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'CourseMode.sku' - db.delete_column('course_modes_coursemode', 'sku') - - models = { - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'sku': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - }, - 'course_modes.coursemodesarchive': { - 'Meta': {'object_name': 'CourseModesArchive'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - } - } - - complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/tests/test_admin.py b/common/djangoapps/course_modes/tests/test_admin.py index 72242d14b2..f65c3a6e9f 100644 --- a/common/djangoapps/course_modes/tests/test_admin.py +++ b/common/djangoapps/course_modes/tests/test_admin.py @@ -21,7 +21,7 @@ from course_modes.admin import CourseModeForm # defined in the LMS and course_modes is in common. However, the benefits # of putting all this configuration in one place outweigh the downsides. # Once the course admin tool is deployed, we can remove this dependency. -from verify_student.models import VerificationDeadline # pylint: disable=import-error +from lms.djangoapps.verify_student.models import VerificationDeadline # We can only test this in the LMS because the course modes admin relies diff --git a/common/djangoapps/course_modes/views.py b/common/djangoapps/course_modes/views.py index 0dc790b766..331ecbd38a 100644 --- a/common/djangoapps/course_modes/views.py +++ b/common/djangoapps/course_modes/views.py @@ -6,6 +6,7 @@ import decimal from ipware.ip import get_ip from django.core.urlresolvers import reverse +from django.db import transaction from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.views.generic.base import View @@ -20,7 +21,7 @@ from courseware.access import has_access from student.models import CourseEnrollment from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.keys import CourseKey -from util.db import commit_on_success_with_read_committed +from util.db import outer_atomic from xmodule.modulestore.django import modulestore from embargo import api as embargo_api @@ -37,7 +38,12 @@ class ChooseModeView(View): """ + @method_decorator(transaction.non_atomic_requests) + def dispatch(self, *args, **kwargs): # pylint: disable=missing-docstring + return super(ChooseModeView, self).dispatch(*args, **kwargs) + @method_decorator(login_required) + @method_decorator(transaction.atomic) def get(self, request, course_id, error=None): """Displays the course mode choice page. @@ -135,8 +141,9 @@ class ChooseModeView(View): return render_to_response("course_modes/choose.html", context) + @method_decorator(transaction.non_atomic_requests) @method_decorator(login_required) - @method_decorator(commit_on_success_with_read_committed) + @method_decorator(outer_atomic(read_committed=True)) def post(self, request, course_id): """Takes the form submission from the page and parses it. diff --git a/common/djangoapps/dark_lang/middleware.py b/common/djangoapps/dark_lang/middleware.py index 868ab05708..d1062c7e40 100644 --- a/common/djangoapps/dark_lang/middleware.py +++ b/common/djangoapps/dark_lang/middleware.py @@ -19,10 +19,8 @@ from openedx.core.djangoapps.user_api.preferences.api import ( ) from lang_pref import LANGUAGE_KEY -# TODO re-import this once we're on Django 1.5 or greater. [PLAT-671] -# from django.utils.translation.trans_real import parse_accept_lang_header -# from django.utils.translation import LANGUAGE_SESSION_KEY -from django_locale.trans_real import parse_accept_lang_header, LANGUAGE_SESSION_KEY +from django.utils.translation.trans_real import parse_accept_lang_header +from django.utils.translation import LANGUAGE_SESSION_KEY def dark_parse_accept_lang_header(accept): diff --git a/common/djangoapps/dark_lang/migrations/0001_initial.py b/common/djangoapps/dark_lang/migrations/0001_initial.py index b2f856ac43..1b3ac52e89 100644 --- a/common/djangoapps/dark_lang/migrations/0001_initial.py +++ b/common/djangoapps/dark_lang/migrations/0001_initial.py @@ -1,74 +1,30 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'DarkLangConfig' - db.create_table('dark_lang_darklangconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('released_languages', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('dark_lang', ['DarkLangConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'DarkLangConfig' - db.delete_table('dark_lang_darklangconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'dark_lang.darklangconfig': { - 'Meta': {'object_name': 'DarkLangConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'released_languages': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - } - } - - complete_apps = ['dark_lang'] + operations = [ + migrations.CreateModel( + name='DarkLangConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('released_languages', models.TextField(help_text=b'A comma-separated list of language codes to release to the public.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/common/djangoapps/dark_lang/migrations/0002_data__enable_on_install.py b/common/djangoapps/dark_lang/migrations/0002_data__enable_on_install.py new file mode 100644 index 0000000000..061168cf20 --- /dev/null +++ b/common/djangoapps/dark_lang/migrations/0002_data__enable_on_install.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +# Converted from the original South migration 0002_enable_on_install.py +# +from django.db import migrations, models + + +def create_dark_lang_config(apps, schema_editor): + """ + Enable DarkLang by default when it is installed, to prevent accidental + release of testing languages. + """ + DarkLangConfig = apps.get_model("dark_lang", "DarkLangConfig") + db_alias = schema_editor.connection.alias + + objects = DarkLangConfig.objects.using(db_alias) + if not objects.exists(): + objects.create(enabled=True) + +def remove_dark_lang_config(apps, schema_editor): + """Write your backwards methods here.""" + raise RuntimeError("Cannot reverse this migration.") + +class Migration(migrations.Migration): + + dependencies = [ + ('dark_lang', '0001_initial'), + ] + + operations = [ + migrations.RunPython(create_dark_lang_config, remove_dark_lang_config), + ] diff --git a/common/djangoapps/dark_lang/migrations/0002_enable_on_install.py b/common/djangoapps/dark_lang/migrations/0002_enable_on_install.py deleted file mode 100644 index c794a156ce..0000000000 --- a/common/djangoapps/dark_lang/migrations/0002_enable_on_install.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - """ - Enable DarkLang by default when it is installed, to prevent accidental - release of testing languages. - """ - orm.DarkLangConfig(enabled=True).save() - - def backwards(self, orm): - "Write your backwards methods here." - raise RuntimeError("Cannot reverse this migration.") - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'dark_lang.darklangconfig': { - 'Meta': {'object_name': 'DarkLangConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'released_languages': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - } - } - - complete_apps = ['dark_lang'] - symmetrical = True diff --git a/common/djangoapps/dark_lang/tests.py b/common/djangoapps/dark_lang/tests.py index 13519b32eb..db529bdb8e 100644 --- a/common/djangoapps/dark_lang/tests.py +++ b/common/djangoapps/dark_lang/tests.py @@ -11,9 +11,7 @@ import unittest from dark_lang.middleware import DarkLangMiddleware from dark_lang.models import DarkLangConfig -# TODO PLAT-671 Import from Django 1.8 -# from django.utils.translation import LANGUAGE_SESSION_KEY -from django_locale.trans_real import LANGUAGE_SESSION_KEY +from django.utils.translation import LANGUAGE_SESSION_KEY from student.tests.factories import UserFactory diff --git a/common/djangoapps/django_comment_common/migrations/0001_initial.py b/common/djangoapps/django_comment_common/migrations/0001_initial.py index f2c3ca3aee..2eb8f7a533 100644 --- a/common/djangoapps/django_comment_common/migrations/0001_initial.py +++ b/common/djangoapps/django_comment_common/migrations/0001_initial.py @@ -1,92 +1,42 @@ # -*- coding: utf-8 -*- -from south.v2 import SchemaMigration +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): -# -# cdodge: This is basically an empty migration since everything has - up to now - managed in the django_comment_client app -# But going forward we should be using this migration -# - def forwards(self, orm): - pass +class Migration(migrations.Migration): - def backwards(self, orm): - pass + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'django_comment_common.permission': { - 'Meta': {'object_name': 'Permission'}, - 'name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'primary_key': 'True'}), - 'roles': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'permissions'", 'symmetrical': 'False', 'to': "orm['django_comment_common.Role']"}) - }, - 'django_comment_common.role': { - 'Meta': {'object_name': 'Role'}, - 'course_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'roles'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['django_comment_common'] + operations = [ + migrations.CreateModel( + name='Permission', + fields=[ + ('name', models.CharField(max_length=30, serialize=False, primary_key=True)), + ], + options={ + 'db_table': 'django_comment_client_permission', + }, + ), + migrations.CreateModel( + name='Role', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=30)), + ('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), + ('users', models.ManyToManyField(related_name='roles', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'django_comment_client_role', + }, + ), + migrations.AddField( + model_name='permission', + name='roles', + field=models.ManyToManyField(related_name='permissions', to='django_comment_common.Role'), + ), + ] diff --git a/common/djangoapps/django_locale/__init__.py b/common/djangoapps/django_locale/__init__.py deleted file mode 100644 index 655019022e..0000000000 --- a/common/djangoapps/django_locale/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -TODO: This module is imported from the stable Django 1.8 branch, as a -copy of https://github.com/django/django/blob/stable/1.8.x/django/middleware/locale.py. - -Remove this file and re-import this middleware from Django once the -codebase is upgraded with a modern version of Django. [PLAT-671] -""" diff --git a/common/djangoapps/django_locale/middleware.py b/common/djangoapps/django_locale/middleware.py deleted file mode 100644 index b0601a807e..0000000000 --- a/common/djangoapps/django_locale/middleware.py +++ /dev/null @@ -1,83 +0,0 @@ -# TODO: This file is imported from the stable Django 1.8 branch. Remove this file -# and re-import this middleware from Django once the codebase is upgraded. [PLAT-671] -# pylint: disable=invalid-name, missing-docstring -"This is the locale selecting middleware that will look at accept headers" - -from django.conf import settings -from django.core.urlresolvers import ( - LocaleRegexURLResolver, get_resolver, get_script_prefix, is_valid_path, -) -from django.http import HttpResponseRedirect -from django.utils import translation -from django.utils.cache import patch_vary_headers -# Override the Django 1.4 implementation with the 1.8 implementation -from django_locale.trans_real import get_language_from_request - - -class LocaleMiddleware(object): - """ - This is a very simple middleware that parses a request - and decides what translation object to install in the current - thread context. This allows pages to be dynamically - translated to the language the user desires (if the language - is available, of course). - """ - response_redirect_class = HttpResponseRedirect - - def __init__(self): - self._is_language_prefix_patterns_used = False - for url_pattern in get_resolver(None).url_patterns: - if isinstance(url_pattern, LocaleRegexURLResolver): - self._is_language_prefix_patterns_used = True - break - - def process_request(self, request): - check_path = self.is_language_prefix_patterns_used() - # This call is broken in Django 1.4: - # https://github.com/django/django/blob/stable/1.4.x/django/utils/translation/trans_real.py#L399 - # (we override parse_accept_lang_header to a fixed version in dark_lang.middleware) - language = get_language_from_request( - request, check_path=check_path) - translation.activate(language) - request.LANGUAGE_CODE = translation.get_language() - - def process_response(self, request, response): - language = translation.get_language() - language_from_path = translation.get_language_from_path(request.path_info) - if (response.status_code == 404 and not language_from_path - and self.is_language_prefix_patterns_used()): - urlconf = getattr(request, 'urlconf', None) - language_path = '/%s%s' % (language, request.path_info) - path_valid = is_valid_path(language_path, urlconf) - if (not path_valid and settings.APPEND_SLASH - and not language_path.endswith('/')): - path_valid = is_valid_path("%s/" % language_path, urlconf) - - if path_valid: - script_prefix = get_script_prefix() - language_url = "%s://%s%s" % ( - request.scheme, - request.get_host(), - # insert language after the script prefix and before the - # rest of the URL - request.get_full_path().replace( - script_prefix, - '%s%s/' % (script_prefix, language), - 1 - ) - ) - return self.response_redirect_class(language_url) - - if not (self.is_language_prefix_patterns_used() - and language_from_path): - patch_vary_headers(response, ('Accept-Language',)) - if 'Content-Language' not in response: - response['Content-Language'] = language - return response - - def is_language_prefix_patterns_used(self): - """ - Returns `True` if the `LocaleRegexURLResolver` is used - at root level of the urlpatterns, else it returns `False`. - """ - return self._is_language_prefix_patterns_used diff --git a/common/djangoapps/django_locale/tests.py b/common/djangoapps/django_locale/tests.py deleted file mode 100644 index cc40ce9d4a..0000000000 --- a/common/djangoapps/django_locale/tests.py +++ /dev/null @@ -1,157 +0,0 @@ -# pylint: disable=invalid-name, line-too-long, super-method-not-called -""" -Tests taken from Django upstream: -https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py -""" -from django.conf import settings -from django.test import TestCase, RequestFactory -from django_locale.trans_real import ( - parse_accept_lang_header, get_language_from_request, LANGUAGE_SESSION_KEY -) - -# Added to test middleware around dark lang -from django.contrib.auth.models import User -from django.test.utils import override_settings -from dark_lang.models import DarkLangConfig - - -# Adding to support test differences between Django and our own settings -@override_settings(LANGUAGES=[ - ('pt', 'Portuguese'), - ('pt-br', 'Portuguese-Brasil'), - ('es', 'Spanish'), - ('es-ar', 'Spanish (Argentina)'), - ('de', 'Deutch'), - ('zh-cn', 'Chinese (China)'), - ('ar-sa', 'Arabic (Saudi Arabia)'), -]) -class MiscTests(TestCase): - """ - Tests taken from Django upstream: - https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py - """ - def setUp(self): - self.rf = RequestFactory() - # Added to test middleware around dark lang - user = User() - user.save() - DarkLangConfig( - released_languages='pt, pt-br, es, de, es-ar, zh-cn, ar-sa', - changed_by=user, - enabled=True - ).save() - - def test_parse_spec_http_header(self): - """ - Testing HTTP header parsing. First, we test that we can parse the - values according to the spec (and that we extract all the pieces in - the right order). - """ - p = parse_accept_lang_header - # Good headers. - self.assertEqual([('de', 1.0)], p('de')) - self.assertEqual([('en-AU', 1.0)], p('en-AU')) - self.assertEqual([('es-419', 1.0)], p('es-419')) - self.assertEqual([('*', 1.0)], p('*;q=1.00')) - self.assertEqual([('en-AU', 0.123)], p('en-AU;q=0.123')) - self.assertEqual([('en-au', 0.5)], p('en-au;q=0.5')) - self.assertEqual([('en-au', 1.0)], p('en-au;q=1.0')) - self.assertEqual([('da', 1.0), ('en', 0.5), ('en-gb', 0.25)], p('da, en-gb;q=0.25, en;q=0.5')) - self.assertEqual([('en-au-xx', 1.0)], p('en-au-xx')) - self.assertEqual([('de', 1.0), ('en-au', 0.75), ('en-us', 0.5), ('en', 0.25), ('es', 0.125), ('fa', 0.125)], p('de,en-au;q=0.75,en-us;q=0.5,en;q=0.25,es;q=0.125,fa;q=0.125')) - self.assertEqual([('*', 1.0)], p('*')) - self.assertEqual([('de', 1.0)], p('de;q=0.')) - self.assertEqual([('en', 1.0), ('*', 0.5)], p('en; q=1.0, * ; q=0.5')) - self.assertEqual([], p('')) - - # Bad headers; should always return []. - self.assertEqual([], p('en-gb;q=1.0000')) - self.assertEqual([], p('en;q=0.1234')) - self.assertEqual([], p('en;q=.2')) - self.assertEqual([], p('abcdefghi-au')) - self.assertEqual([], p('**')) - self.assertEqual([], p('en,,gb')) - self.assertEqual([], p('en-au;q=0.1.0')) - self.assertEqual([], p('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXZ,en')) - self.assertEqual([], p('da, en-gb;q=0.8, en;q=0.7,#')) - self.assertEqual([], p('de;q=2.0')) - self.assertEqual([], p('de;q=0.a')) - self.assertEqual([], p('12-345')) - self.assertEqual([], p('')) - - def test_parse_literal_http_header(self): - """ - Now test that we parse a literal HTTP header correctly. - """ - g = get_language_from_request - r = self.rf.get('/') - r.COOKIES = {} - r.META = {'HTTP_ACCEPT_LANGUAGE': 'pt-br'} - self.assertEqual('pt-br', g(r)) - - r.META = {'HTTP_ACCEPT_LANGUAGE': 'pt'} - self.assertEqual('pt', g(r)) - - r.META = {'HTTP_ACCEPT_LANGUAGE': 'es,de'} - self.assertEqual('es', g(r)) - - r.META = {'HTTP_ACCEPT_LANGUAGE': 'es-ar,de'} - self.assertEqual('es-ar', g(r)) - - # This test assumes there won't be a Django translation to a US - # variation of the Spanish language, a safe assumption. When the - # user sets it as the preferred language, the main 'es' - # translation should be selected instead. - r.META = {'HTTP_ACCEPT_LANGUAGE': 'es-us'} - self.assertEqual(g(r), 'es') - - # This tests the following scenario: there isn't a main language (zh) - # translation of Django but there is a translation to variation (zh_CN) - # the user sets zh-cn as the preferred language, it should be selected - # by Django without falling back nor ignoring it. - r.META = {'HTTP_ACCEPT_LANGUAGE': 'zh-cn,de'} - self.assertEqual(g(r), 'zh-cn') - - def test_logic_masked_by_darklang(self): - g = get_language_from_request - r = self.rf.get('/') - r.COOKIES = {} - r.META = {'HTTP_ACCEPT_LANGUAGE': 'ar-qa'} - self.assertEqual('ar-sa', g(r)) - - r.session = {LANGUAGE_SESSION_KEY: 'es'} - self.assertEqual('es', g(r)) - - def test_parse_language_cookie(self): - """ - Now test that we parse language preferences stored in a cookie correctly. - """ - g = get_language_from_request - r = self.rf.get('/') - r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt-br'} - r.META = {} - self.assertEqual('pt-br', g(r)) - - r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'pt'} - r.META = {} - self.assertEqual('pt', g(r)) - - r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es'} - r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'} - self.assertEqual('es', g(r)) - - # This test assumes there won't be a Django translation to a US - # variation of the Spanish language, a safe assumption. When the - # user sets it as the preferred language, the main 'es' - # translation should be selected instead. - r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'es-us'} - r.META = {} - self.assertEqual(g(r), 'es') - - # This tests the following scenario: there isn't a main language (zh) - # translation of Django but there is a translation to variation (zh_CN) - # the user sets zh-cn as the preferred language, it should be selected - # by Django without falling back nor ignoring it. - r.COOKIES = {settings.LANGUAGE_COOKIE_NAME: 'zh-cn'} - r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'} - self.assertEqual(g(r), 'zh-cn') diff --git a/common/djangoapps/django_locale/trans_real.py b/common/djangoapps/django_locale/trans_real.py deleted file mode 100644 index 3ec6b6d026..0000000000 --- a/common/djangoapps/django_locale/trans_real.py +++ /dev/null @@ -1,131 +0,0 @@ -"""Translation helper functions.""" -# Imported from Django 1.8 -# pylint: disable=invalid-name -import re -from django.conf import settings -from django.conf.locale import LANG_INFO -from django.utils import translation - - -# Format of Accept-Language header values. From RFC 2616, section 14.4 and 3.9. -# and RFC 3066, section 2.1 -accept_language_re = re.compile(r''' - ([A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*|\*) # "en", "en-au", "x-y-z", "*" - (?:\s*;\s*q=(0(?:\.\d{,3})?|1(?:.0{,3})?))? # Optional "q=1.00", "q=0.8" - (?:\s*,\s*|$) # Multiple accepts per header. - ''', re.VERBOSE) - - -language_code_re = re.compile(r'^[a-z]{1,8}(?:-[a-z0-9]{1,8})*$', re.IGNORECASE) - - -LANGUAGE_SESSION_KEY = '_language' - - -def parse_accept_lang_header(lang_string): - """ - Parses the lang_string, which is the body of an HTTP Accept-Language - header, and returns a list of (lang, q-value), ordered by 'q' values. - - Any format errors in lang_string results in an empty list being returned. - """ - # parse_accept_lang_header is broken until we are on Django 1.5 or greater - # See https://code.djangoproject.com/ticket/19381 - result = [] - pieces = accept_language_re.split(lang_string) - if pieces[-1]: - return [] - for i in range(0, len(pieces) - 1, 3): - first, lang, priority = pieces[i: i + 3] - if first: - return [] - priority = priority and float(priority) or 1.0 - result.append((lang, priority)) - result.sort(key=lambda k: k[1], reverse=True) - return result - - -def get_supported_language_variant(lang_code, strict=False): - """ - Returns the language-code that's listed in supported languages, possibly - selecting a more generic variant. Raises LookupError if nothing found. - If `strict` is False (the default), the function will look for an alternative - country-specific variant when the currently checked is not found. - lru_cache should have a maxsize to prevent from memory exhaustion attacks, - as the provided language codes are taken from the HTTP request. See also - . - """ - if lang_code: - # If 'fr-ca' is not supported, try special fallback or language-only 'fr'. - possible_lang_codes = [lang_code] - try: - # TODO skip this, or import updated LANG_INFO format from __future__ - # (fallback option wasn't added until - # https://github.com/django/django/commit/5dcdbe95c749d36072f527e120a8cb463199ae0d) - possible_lang_codes.extend(LANG_INFO[lang_code]['fallback']) - except KeyError: - pass - generic_lang_code = lang_code.split('-')[0] - possible_lang_codes.append(generic_lang_code) - supported_lang_codes = dict(settings.LANGUAGES) - - for code in possible_lang_codes: - # Note: django 1.4 implementation of check_for_language is OK to use - if code in supported_lang_codes and translation.check_for_language(code): - return code - if not strict: - # if fr-fr is not supported, try fr-ca. - for supported_code in supported_lang_codes: - if supported_code.startswith(generic_lang_code + '-'): - return supported_code - raise LookupError(lang_code) - - -def get_language_from_request(request, check_path=False): - """ - Analyzes the request to find what language the user wants the system to - show. Only languages listed in settings.LANGUAGES are taken into account. - If the user requests a sublanguage where we have a main language, we send - out the main language. - If check_path is True, the URL path prefix will be checked for a language - code, otherwise this is skipped for backwards compatibility. - """ - if check_path: - # Note: django 1.4 implementation of get_language_from_path is OK to use - lang_code = translation.get_language_from_path(request.path_info) - if lang_code is not None: - return lang_code - - supported_lang_codes = dict(settings.LANGUAGES) - - if hasattr(request, 'session'): - lang_code = request.session.get(LANGUAGE_SESSION_KEY) - # Note: django 1.4 implementation of check_for_language is OK to use - if lang_code in supported_lang_codes and lang_code is not None and translation.check_for_language(lang_code): - return lang_code - - lang_code = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME) - - try: - return get_supported_language_variant(lang_code) - except LookupError: - pass - - accept = request.META.get('HTTP_ACCEPT_LANGUAGE', '') - # broken in 1.4, so defined above - for accept_lang, unused in parse_accept_lang_header(accept): - if accept_lang == '*': - break - - if not language_code_re.search(accept_lang): - continue - - try: - return get_supported_language_variant(accept_lang) - except LookupError: - continue - - try: - return get_supported_language_variant(settings.LANGUAGE_CODE) - except LookupError: - return settings.LANGUAGE_CODE diff --git a/common/djangoapps/edxmako/makoloader.py b/common/djangoapps/edxmako/makoloader.py index 33122b944f..994346a2ba 100644 --- a/common/djangoapps/edxmako/makoloader.py +++ b/common/djangoapps/edxmako/makoloader.py @@ -1,10 +1,11 @@ import logging from django.conf import settings +from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist -from django.template.loader import make_origin, get_template_from_string from django.template.loaders.filesystem import Loader as FilesystemLoader from django.template.loaders.app_directories import Loader as AppDirectoriesLoader +from django.template import Engine from edxmako.template import Template @@ -50,14 +51,17 @@ class MakoLoader(object): return template, None else: # This is a regular template - origin = make_origin(file_path, self.load_template_source, template_name, template_dirs) try: - template = get_template_from_string(source, origin, template_name) + template = Engine.get_default().from_string(source) return template, None + except ImproperlyConfigured: + # Either no DjangoTemplates engine was configured -or- multiple engines + # were configured, making the get_default() call above fail. + raise except TemplateDoesNotExist: - # If compiling the template we found raises TemplateDoesNotExist, back off to - # returning the source and display name for the template we were asked to load. - # This allows for correct identification (later) of the actual template that does + # If compiling the loaded template raises TemplateDoesNotExist, back off to + # returning the source and display name for the requested template. + # This allows for eventual correct identification of the actual template that does # not exist. return source, file_path @@ -71,13 +75,15 @@ class MakoLoader(object): class MakoFilesystemLoader(MakoLoader): is_usable = True + _accepts_engine_in_init = True - def __init__(self): - MakoLoader.__init__(self, FilesystemLoader()) + def __init__(self, *args): + MakoLoader.__init__(self, FilesystemLoader(*args)) class MakoAppDirectoriesLoader(MakoLoader): is_usable = True + _accepts_engine_in_init = True - def __init__(self): - MakoLoader.__init__(self, AppDirectoriesLoader()) + def __init__(self, *args): + MakoLoader.__init__(self, AppDirectoriesLoader(*args)) diff --git a/common/djangoapps/edxmako/management/commands/preprocess_assets.py b/common/djangoapps/edxmako/management/commands/preprocess_assets.py index 805981327e..8d3cf5608a 100644 --- a/common/djangoapps/edxmako/management/commands/preprocess_assets.py +++ b/common/djangoapps/edxmako/management/commands/preprocess_assets.py @@ -23,6 +23,10 @@ class Command(BaseCommand): help = "Preprocess asset template files to ready them for compilation." + def add_arguments(self, parser): + parser.add_argument('files', type=unicode, nargs='+', help='files to pre-process') + parser.add_argument('dest_dir', type=unicode, help='destination directory') + def handle(self, *args, **options): theme_name = getattr(settings, "THEME_NAME", None) use_custom_theme = settings.FEATURES.get("USE_CUSTOM_THEME", False) @@ -30,8 +34,8 @@ class Command(BaseCommand): # No custom theme, nothing to do! return - dest_dir = args[-1] - for source_file in args[:-1]: + dest_dir = options['dest_dir'] + for source_file in options['files']: self.process_one_file(source_file, dest_dir, theme_name) def process_one_file(self, source_file, dest_dir, theme_name): diff --git a/common/djangoapps/edxmako/middleware.py b/common/djangoapps/edxmako/middleware.py index 5d9f8cbdfc..cb67e2f142 100644 --- a/common/djangoapps/edxmako/middleware.py +++ b/common/djangoapps/edxmako/middleware.py @@ -13,7 +13,10 @@ # limitations under the License. import threading +from django.conf import settings from django.template import RequestContext +from django.template.context import _builtin_context_processors +from django.utils.module_loading import import_string from util.request import safe_get_host REQUEST_CONTEXT = threading.local() @@ -31,6 +34,15 @@ class MakoMiddleware(object): return response +def get_template_context_processors(): + """ + Returns the context processors defined in settings.TEMPLATES. + """ + context_processors = _builtin_context_processors + context_processors += tuple(settings.DEFAULT_TEMPLATE_ENGINE['OPTIONS']['context_processors']) + return tuple(import_string(path) for path in context_processors) + + def get_template_request_context(): """ Returns the template processing context to use for the current request, @@ -42,4 +54,12 @@ def get_template_request_context(): context = RequestContext(request) context['is_secure'] = request.is_secure() context['site'] = safe_get_host(request) + + # This used to happen when a RequestContext object was initialized but was + # moved to a different part of the logic when template engines were introduced. + # Since we are not using template engines we do this here. + # https://github.com/django/django/commit/37505b6397058bcc3460f23d48a7de9641cd6ef0 + for processor in get_template_context_processors(): + context.update(processor(request)) + return context diff --git a/common/djangoapps/embargo/forms.py b/common/djangoapps/embargo/forms.py index 96f1b0c2ad..12c845bfe2 100644 --- a/common/djangoapps/embargo/forms.py +++ b/common/djangoapps/embargo/forms.py @@ -27,6 +27,7 @@ class RestrictedCourseForm(forms.ModelForm): """ class Meta(object): model = RestrictedCourse + fields = '__all__' def clean_course_key(self): """Validate the course key. @@ -60,6 +61,7 @@ class IPFilterForm(forms.ModelForm): class Meta(object): model = IPFilter + fields = '__all__' def _is_valid_ip(self, address): """Whether or not address is a valid ipv4 address or ipv6 address""" diff --git a/common/djangoapps/embargo/migrations/0001_initial.py b/common/djangoapps/embargo/migrations/0001_initial.py index ce3a6198a0..827928930a 100644 --- a/common/djangoapps/embargo/migrations/0001_initial.py +++ b/common/djangoapps/embargo/migrations/0001_initial.py @@ -1,114 +1,104 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django_countries.fields +import django.db.models.deletion +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'EmbargoedCourse' - db.create_table('embargo_embargoedcourse', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)), - ('embargoed', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('embargo', ['EmbargoedCourse']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'EmbargoedState' - db.create_table('embargo_embargoedstate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('embargoed_countries', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('embargo', ['EmbargoedState']) - - # Adding model 'IPFilter' - db.create_table('embargo_ipfilter', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('whitelist', self.gf('django.db.models.fields.TextField')(blank=True)), - ('blacklist', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('embargo', ['IPFilter']) - - - def backwards(self, orm): - # Deleting model 'EmbargoedCourse' - db.delete_table('embargo_embargoedcourse') - - # Deleting model 'EmbargoedState' - db.delete_table('embargo_embargoedstate') - - # Deleting model 'IPFilter' - db.delete_table('embargo_ipfilter') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - } - } - - complete_apps = ['embargo'] + operations = [ + migrations.CreateModel( + name='Country', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('country', django_countries.fields.CountryField(help_text='Two character ISO country code.', unique=True, max_length=2, db_index=True)), + ], + options={ + 'ordering': ['country'], + }, + ), + migrations.CreateModel( + name='CountryAccessRule', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('rule_type', models.CharField(default=b'blacklist', help_text='Whether to include or exclude the given course. If whitelist countries are specified, then ONLY users from whitelisted countries will be able to access the course. If blacklist countries are specified, then users from blacklisted countries will NOT be able to access the course.', max_length=255, choices=[(b'whitelist', b'Whitelist (allow only these countries)'), (b'blacklist', b'Blacklist (block these countries)')])), + ('country', models.ForeignKey(help_text='The country to which this rule applies.', to='embargo.Country')), + ], + ), + migrations.CreateModel( + name='CourseAccessRuleHistory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('snapshot', models.TextField(null=True, blank=True)), + ], + options={ + 'get_latest_by': 'timestamp', + }, + ), + migrations.CreateModel( + name='EmbargoedCourse', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), + ('embargoed', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='EmbargoedState', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('embargoed_countries', models.TextField(help_text=b'A comma-separated list of country codes that fall under U.S. embargo restrictions', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='IPFilter', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('whitelist', models.TextField(help_text=b'A comma-separated list of IP addresses that should not fall under embargo restrictions.', blank=True)), + ('blacklist', models.TextField(help_text=b'A comma-separated list of IP addresses that should fall under embargo restrictions.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='RestrictedCourse', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_key', xmodule_django.models.CourseKeyField(help_text='The course key for the restricted course.', unique=True, max_length=255, db_index=True)), + ('enroll_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from enrollment.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])), + ('access_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from accessing a course.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])), + ('disable_access_check', models.BooleanField(default=False, help_text='Allow users who enrolled in an allowed country to access restricted courses from excluded countries.')), + ], + ), + migrations.AddField( + model_name='countryaccessrule', + name='restricted_course', + field=models.ForeignKey(help_text='The course to which this rule applies.', to='embargo.RestrictedCourse'), + ), + migrations.AlterUniqueTogether( + name='countryaccessrule', + unique_together=set([('restricted_course', 'country')]), + ), + ] diff --git a/common/djangoapps/embargo/migrations/0002_add_country_access_models.py b/common/djangoapps/embargo/migrations/0002_add_country_access_models.py deleted file mode 100644 index e1a9efe007..0000000000 --- a/common/djangoapps/embargo/migrations/0002_add_country_access_models.py +++ /dev/null @@ -1,141 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Country' - db.create_table('embargo_country', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('country', self.gf('django_countries.fields.CountryField')(unique=True, max_length=2, db_index=True)), - )) - db.send_create_signal('embargo', ['Country']) - - # Adding model 'RestrictedCourse' - db.create_table('embargo_restrictedcourse', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), - ('enroll_msg_key', self.gf('django.db.models.fields.CharField')(default='default', max_length=255)), - ('access_msg_key', self.gf('django.db.models.fields.CharField')(default='default', max_length=255)), - )) - db.send_create_signal('embargo', ['RestrictedCourse']) - - # Adding model 'CountryAccessRule' - db.create_table('embargo_countryaccessrule', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('rule_type', self.gf('django.db.models.fields.CharField')(default='blacklist', max_length=255)), - ('restricted_course', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['embargo.RestrictedCourse'])), - ('country', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['embargo.Country'])), - )) - db.send_create_signal('embargo', ['CountryAccessRule']) - - # Adding unique constraint on 'CountryAccessRule', fields ['restricted_course', 'country'] - db.create_unique('embargo_countryaccessrule', ['restricted_course_id', 'country_id']) - - - # Changing field 'EmbargoedCourse.course_id' - db.alter_column('embargo_embargoedcourse', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255)) - - def backwards(self, orm): - # Removing unique constraint on 'CountryAccessRule', fields ['restricted_course', 'country'] - db.delete_unique('embargo_countryaccessrule', ['restricted_course_id', 'country_id']) - - # Deleting model 'Country' - db.delete_table('embargo_country') - - # Deleting model 'RestrictedCourse' - db.delete_table('embargo_restrictedcourse') - - # Deleting model 'CountryAccessRule' - db.delete_table('embargo_countryaccessrule') - - - # Changing field 'EmbargoedCourse.course_id' - db.alter_column('embargo_embargoedcourse', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.country': { - 'Meta': {'ordering': "['country']", 'object_name': 'Country'}, - 'country': ('django_countries.fields.CountryField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.countryaccessrule': { - 'Meta': {'unique_together': "(('restricted_course', 'country'),)", 'object_name': 'CountryAccessRule'}, - 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.Country']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'restricted_course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.RestrictedCourse']"}), - 'rule_type': ('django.db.models.fields.CharField', [], {'default': "'blacklist'", 'max_length': '255'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'embargo.restrictedcourse': { - 'Meta': {'object_name': 'RestrictedCourse'}, - 'access_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enroll_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['embargo'] \ No newline at end of file diff --git a/common/djangoapps/embargo/migrations/0002_data__add_countries.py b/common/djangoapps/embargo/migrations/0002_data__add_countries.py new file mode 100644 index 0000000000..ae738a2863 --- /dev/null +++ b/common/djangoapps/embargo/migrations/0002_data__add_countries.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +# Converted from the original South migration 0003_add_countries.py + +from django.db import migrations, models +from django_countries import countries + + +def create_embargo_countries(apps, schema_editor): + """Populate the available countries with all 2-character ISO country codes. """ + country_model = apps.get_model("embargo", "Country") + db_alias = schema_editor.connection.alias + for country_code, __ in list(countries): + country_model.objects.using(db_alias).get_or_create(country=country_code) + +def remove_embargo_countries(apps, schema_editor): + """Clear all available countries. """ + country_model = apps.get_model("embargo", "Country") + db_alias = schema_editor.connection.alias + country_model.objects.using(db_alias).all().delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('embargo', '0001_initial'), + ] + + operations = [ + migrations.RunPython(create_embargo_countries, remove_embargo_countries), + ] + diff --git a/common/djangoapps/embargo/migrations/0003_add_countries.py b/common/djangoapps/embargo/migrations/0003_add_countries.py deleted file mode 100644 index a1582258af..0000000000 --- a/common/djangoapps/embargo/migrations/0003_add_countries.py +++ /dev/null @@ -1,101 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models -from django_countries import countries - -class Migration(DataMigration): - - def forwards(self, orm): - """Populate the available countries with all 2-character ISO country codes. """ - for country_code, __ in list(countries): - orm.Country.objects.get_or_create(country=country_code) - - def backwards(self, orm): - """Clear all available countries. """ - orm.Country.objects.all().delete() - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.country': { - 'Meta': {'object_name': 'Country'}, - 'country': ('django_countries.fields.CountryField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.countryaccessrule': { - 'Meta': {'unique_together': "(('restricted_course', 'rule_type'),)", 'object_name': 'CountryAccessRule'}, - 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.Country']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'restricted_course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.RestrictedCourse']"}), - 'rule_type': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'embargo.restrictedcourse': { - 'Meta': {'object_name': 'RestrictedCourse'}, - 'access_msg_key': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enroll_msg_key': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['embargo'] - symmetrical = True diff --git a/common/djangoapps/embargo/migrations/0004_migrate_embargo_config.py b/common/djangoapps/embargo/migrations/0004_migrate_embargo_config.py deleted file mode 100644 index 6d577f39c3..0000000000 --- a/common/djangoapps/embargo/migrations/0004_migrate_embargo_config.py +++ /dev/null @@ -1,129 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - """Move the current course embargo configuration to the new models. """ - for old_course in orm.EmbargoedCourse.objects.all(): - new_course, __ = orm.RestrictedCourse.objects.get_or_create(course_key=old_course.course_id) - - # Set the message keys to 'embargo' - new_course.enroll_msg_key = 'embargo' - new_course.access_msg_key = 'embargo' - new_course.save() - - for country in self._embargoed_countries_list(orm): - country_model = orm.Country.objects.get(country=country) - orm.CountryAccessRule.objects.get_or_create( - country=country_model, - rule_type='blacklist', - restricted_course=new_course - ) - - def backwards(self, orm): - """No backwards migration required since the forward migration is idempotent. """ - pass - - def _embargoed_countries_list(self, orm): - """Retrieve the list of embargoed countries from the existing tables. """ - # We need to replicate some application logic here, because South - # doesn't give us access to class methods on the Django model objects. - try: - current_config = orm.EmbargoedState.objects.order_by('-change_date')[0] - if current_config.enabled and current_config.embargoed_countries: - return [ - country.strip().upper() for country - in current_config.embargoed_countries.split(',') - ] - except IndexError: - pass - - return [] - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.country': { - 'Meta': {'ordering': "['country']", 'object_name': 'Country'}, - 'country': ('django_countries.fields.CountryField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.countryaccessrule': { - 'Meta': {'unique_together': "(('restricted_course', 'country'),)", 'object_name': 'CountryAccessRule'}, - 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.Country']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'restricted_course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.RestrictedCourse']"}), - 'rule_type': ('django.db.models.fields.CharField', [], {'default': "'blacklist'", 'max_length': '255'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'embargo.restrictedcourse': { - 'Meta': {'object_name': 'RestrictedCourse'}, - 'access_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enroll_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['embargo'] - symmetrical = True diff --git a/common/djangoapps/embargo/migrations/0005_add_courseaccessrulehistory.py b/common/djangoapps/embargo/migrations/0005_add_courseaccessrulehistory.py deleted file mode 100644 index 1f99a113be..0000000000 --- a/common/djangoapps/embargo/migrations/0005_add_courseaccessrulehistory.py +++ /dev/null @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseAccessRuleHistory' - db.create_table('embargo_courseaccessrulehistory', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('snapshot', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('embargo', ['CourseAccessRuleHistory']) - - - def backwards(self, orm): - # Deleting model 'CourseAccessRuleHistory' - db.delete_table('embargo_courseaccessrulehistory') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.country': { - 'Meta': {'ordering': "['country']", 'object_name': 'Country'}, - 'country': ('django_countries.fields.CountryField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.countryaccessrule': { - 'Meta': {'unique_together': "(('restricted_course', 'country'),)", 'object_name': 'CountryAccessRule'}, - 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.Country']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'restricted_course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.RestrictedCourse']"}), - 'rule_type': ('django.db.models.fields.CharField', [], {'default': "'blacklist'", 'max_length': '255'}) - }, - 'embargo.courseaccessrulehistory': { - 'Meta': {'object_name': 'CourseAccessRuleHistory'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'snapshot': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'embargo.restrictedcourse': { - 'Meta': {'object_name': 'RestrictedCourse'}, - 'access_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enroll_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['embargo'] \ No newline at end of file diff --git a/common/djangoapps/embargo/migrations/0006_auto__add_field_restrictedcourse_disable_access_check.py b/common/djangoapps/embargo/migrations/0006_auto__add_field_restrictedcourse_disable_access_check.py deleted file mode 100644 index cfda42e042..0000000000 --- a/common/djangoapps/embargo/migrations/0006_auto__add_field_restrictedcourse_disable_access_check.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'RestrictedCourse.disable_access_check' - db.add_column('embargo_restrictedcourse', 'disable_access_check', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'RestrictedCourse.disable_access_check' - db.delete_column('embargo_restrictedcourse', 'disable_access_check') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'embargo.country': { - 'Meta': {'ordering': "['country']", 'object_name': 'Country'}, - 'country': ('django_countries.fields.CountryField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.countryaccessrule': { - 'Meta': {'unique_together': "(('restricted_course', 'country'),)", 'object_name': 'CountryAccessRule'}, - 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.Country']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'restricted_course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['embargo.RestrictedCourse']"}), - 'rule_type': ('django.db.models.fields.CharField', [], {'default': "'blacklist'", 'max_length': '255'}) - }, - 'embargo.courseaccessrulehistory': { - 'Meta': {'object_name': 'CourseAccessRuleHistory'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'snapshot': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) - }, - 'embargo.embargoedcourse': { - 'Meta': {'object_name': 'EmbargoedCourse'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'embargoed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.embargoedstate': { - 'Meta': {'object_name': 'EmbargoedState'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'embargoed_countries': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'embargo.ipfilter': { - 'Meta': {'object_name': 'IPFilter'}, - 'blacklist': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'whitelist': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'embargo.restrictedcourse': { - 'Meta': {'object_name': 'RestrictedCourse'}, - 'access_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'disable_access_check': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'enroll_msg_key': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['embargo'] \ No newline at end of file diff --git a/common/djangoapps/embargo/tests/test_api.py b/common/djangoapps/embargo/tests/test_api.py index ca6fcaecd1..16bcaae6ce 100644 --- a/common/djangoapps/embargo/tests/test_api.py +++ b/common/djangoapps/embargo/tests/test_api.py @@ -159,7 +159,6 @@ class EmbargoCheckAccessApiTests(ModuleStoreTestCase): # (because when we save it, it will set the database field to an empty string instead of NULL) query = "UPDATE auth_userprofile SET country = NULL WHERE id = %s" connection.cursor().execute(query, [str(self.user.profile.id)]) - transaction.commit_unless_managed() # Verify that we can check the user's access without error result = embargo_api.check_course_access(self.course.id, user=self.user, ip_address='0.0.0.0') @@ -171,7 +170,7 @@ class EmbargoCheckAccessApiTests(ModuleStoreTestCase): # (restricted course, but pass all the checks) # This is the worst case, so it will hit all of the # caching code. - with self.assertNumQueries(4): + with self.assertNumQueries(3): embargo_api.check_course_access(self.course.id, user=self.user, ip_address='0.0.0.0') with self.assertNumQueries(0): diff --git a/common/djangoapps/enrollment/api.py b/common/djangoapps/enrollment/api.py index f9edd9e414..f7774b53a1 100644 --- a/common/djangoapps/enrollment/api.py +++ b/common/djangoapps/enrollment/api.py @@ -3,7 +3,7 @@ Enrollment API for creating, updating, and deleting enrollments. Also provides a course level, such as available course modes. """ -from django.utils import importlib +import importlib import logging from django.conf import settings from django.core.cache import cache diff --git a/common/djangoapps/external_auth/migrations/0001_initial.py b/common/djangoapps/external_auth/migrations/0001_initial.py index cf93c99d6b..f68b8f0e88 100644 --- a/common/djangoapps/external_auth/migrations/0001_initial.py +++ b/common/djangoapps/external_auth/migrations/0001_initial.py @@ -1,90 +1,34 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'ExternalAuthMap' - db.create_table('external_auth_externalauthmap', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('external_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('external_domain', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('external_credentials', self.gf('django.db.models.fields.TextField')(blank=True)), - ('external_email', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('external_name', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, blank=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, null=True)), - ('internal_password', self.gf('django.db.models.fields.CharField')(max_length=31, blank=True)), - ('dtcreated', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('dtsignup', self.gf('django.db.models.fields.DateTimeField')(null=True)), - )) - db.send_create_signal('external_auth', ['ExternalAuthMap']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding unique constraint on 'ExternalAuthMap', fields ['external_id', 'external_domain'] - db.create_unique('external_auth_externalauthmap', ['external_id', 'external_domain']) - - - def backwards(self, orm): - # Removing unique constraint on 'ExternalAuthMap', fields ['external_id', 'external_domain'] - db.delete_unique('external_auth_externalauthmap', ['external_id', 'external_domain']) - - # Deleting model 'ExternalAuthMap' - db.delete_table('external_auth_externalauthmap') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'external_auth.externalauthmap': { - 'Meta': {'unique_together': "(('external_id', 'external_domain'),)", 'object_name': 'ExternalAuthMap'}, - 'dtcreated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'dtsignup': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'external_credentials': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'external_domain': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'external_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'external_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_password': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'null': 'True'}) - } - } - - complete_apps = ['external_auth'] + operations = [ + migrations.CreateModel( + name='ExternalAuthMap', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('external_id', models.CharField(max_length=255, db_index=True)), + ('external_domain', models.CharField(max_length=255, db_index=True)), + ('external_credentials', models.TextField(blank=True)), + ('external_email', models.CharField(max_length=255, db_index=True)), + ('external_name', models.CharField(db_index=True, max_length=255, blank=True)), + ('internal_password', models.CharField(max_length=31, blank=True)), + ('dtcreated', models.DateTimeField(auto_now_add=True, verbose_name=b'creation date')), + ('dtsignup', models.DateTimeField(null=True, verbose_name=b'signup date')), + ('user', models.OneToOneField(null=True, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AlterUniqueTogether( + name='externalauthmap', + unique_together=set([('external_id', 'external_domain')]), + ), + ] diff --git a/common/djangoapps/external_auth/models.py b/common/djangoapps/external_auth/models.py index 65150dea9d..56307257ef 100644 --- a/common/djangoapps/external_auth/models.py +++ b/common/djangoapps/external_auth/models.py @@ -15,6 +15,7 @@ from django.contrib.auth.models import User class ExternalAuthMap(models.Model): class Meta(object): + app_label = "external_auth" unique_together = (('external_id', 'external_domain'), ) external_id = models.CharField(max_length=255, db_index=True) diff --git a/common/djangoapps/external_auth/tests/test_shib.py b/common/djangoapps/external_auth/tests/test_shib.py index 5d8553fa1a..d77bd5ffb6 100644 --- a/common/djangoapps/external_auth/tests/test_shib.py +++ b/common/djangoapps/external_auth/tests/test_shib.py @@ -13,7 +13,7 @@ from django.test.client import RequestFactory, Client as DjangoTestClient from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser, User -from django.utils.importlib import import_module +from importlib import import_module from edxmako.tests import mako_middleware_process_request from external_auth.models import ExternalAuthMap from external_auth.views import ( diff --git a/common/djangoapps/external_auth/views.py b/common/djangoapps/external_auth/views.py index 7c66778d45..4edea0973c 100644 --- a/common/djangoapps/external_auth/views.py +++ b/common/djangoapps/external_auth/views.py @@ -195,7 +195,7 @@ def _external_login_or_signup(request, if settings.AUTHENTICATION_BACKENDS: auth_backend = settings.AUTHENTICATION_BACKENDS[0] else: - auth_backend = 'django.contrib.auth.backends.ModelBackend' + auth_backend = 'ratelimitbackend.backends.RateLimitModelBackend' user.backend = auth_backend if settings.FEATURES['SQUELCH_PII_IN_LOGS']: AUDIT_LOG.info(u'Linked user.id: {0} logged in via Shibboleth'.format(user.id)) @@ -204,7 +204,7 @@ def _external_login_or_signup(request, elif uses_certs: # Certificates are trusted, so just link the user and log the action user = internal_user - user.backend = 'django.contrib.auth.backends.ModelBackend' + user.backend = 'ratelimitbackend.backends.RateLimitModelBackend' if settings.FEATURES['SQUELCH_PII_IN_LOGS']: AUDIT_LOG.info(u'Linked user_id {0} logged in via SSL certificate'.format(user.id)) else: @@ -923,7 +923,7 @@ def provider_identity(request): response = render_to_response('identity.xml', {'url': get_xrds_url('login', request)}, - mimetype='text/xml') + content_type='text/xml') # custom XRDS header necessary for discovery process response['X-XRDS-Location'] = get_xrds_url('identity', request) @@ -937,7 +937,7 @@ def provider_xrds(request): response = render_to_response('xrds.xml', {'url': get_xrds_url('login', request)}, - mimetype='text/xml') + content_type='text/xml') # custom XRDS header necessary for discovery process response['X-XRDS-Location'] = get_xrds_url('xrds', request) diff --git a/common/djangoapps/heartbeat/tests/test_heartbeat.py b/common/djangoapps/heartbeat/tests/test_heartbeat.py index a879ebb404..345ede2bb9 100644 --- a/common/djangoapps/heartbeat/tests/test_heartbeat.py +++ b/common/djangoapps/heartbeat/tests/test_heartbeat.py @@ -6,14 +6,13 @@ import json from django.core.urlresolvers import reverse from django.db.utils import DatabaseError from django.test.client import Client -from django.test.testcases import TestCase +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from mock import patch from xmodule.exceptions import HeartbeatFailure -@patch('heartbeat.views.modulestore') -class HeartbeatTestCase(TestCase): +class HeartbeatTestCase(ModuleStoreTestCase): """ Test the heartbeat """ @@ -23,19 +22,20 @@ class HeartbeatTestCase(TestCase): self.heartbeat_url = reverse('heartbeat') return super(HeartbeatTestCase, self).setUp() - def test_success(self, mock_modulestore): # pylint: disable=unused-argument + def test_success(self): response = self.client.get(self.heartbeat_url) self.assertEqual(response.status_code, 200) - @patch('heartbeat.views.connection') - def test_sql_fail(self, mock_connection, mock_modulestore): # pylint: disable=unused-argument - mock_connection.cursor.return_value.execute.side_effect = DatabaseError - response = self.client.get(self.heartbeat_url) - self.assertEqual(response.status_code, 503) - response_dict = json.loads(response.content) - self.assertIn('SQL', response_dict) + def test_sql_fail(self): + with patch('heartbeat.views.connection') as mock_connection: + mock_connection.cursor.return_value.execute.side_effect = DatabaseError + response = self.client.get(self.heartbeat_url) + self.assertEqual(response.status_code, 503) + response_dict = json.loads(response.content) + self.assertIn('SQL', response_dict) - def test_modulestore_fail(self, mock_modulestore): # pylint: disable=unused-argument - mock_modulestore.return_value.heartbeat.side_effect = HeartbeatFailure('msg', 'service') - response = self.client.get(self.heartbeat_url) - self.assertEqual(response.status_code, 503) + def test_modulestore_fail(self): + with patch('heartbeat.views.modulestore') as mock_modulestore: + mock_modulestore.return_value.heartbeat.side_effect = HeartbeatFailure('msg', 'service') + response = self.client.get(self.heartbeat_url) + self.assertEqual(response.status_code, 503) diff --git a/common/djangoapps/lang_pref/middleware.py b/common/djangoapps/lang_pref/middleware.py index 1631a871a0..e41d7c902d 100644 --- a/common/djangoapps/lang_pref/middleware.py +++ b/common/djangoapps/lang_pref/middleware.py @@ -4,9 +4,7 @@ Middleware for Language Preferences from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from lang_pref import LANGUAGE_KEY -# TODO PLAT-671 Import from Django 1.8 -# from django.utils.translation import LANGUAGE_SESSION_KEY -from django_locale.trans_real import LANGUAGE_SESSION_KEY +from django.utils.translation import LANGUAGE_SESSION_KEY class LanguagePreferenceMiddleware(object): diff --git a/common/djangoapps/lang_pref/tests/test_middleware.py b/common/djangoapps/lang_pref/tests/test_middleware.py index 46934db6e1..174a888c8d 100644 --- a/common/djangoapps/lang_pref/tests/test_middleware.py +++ b/common/djangoapps/lang_pref/tests/test_middleware.py @@ -1,9 +1,7 @@ from django.test import TestCase from django.test.client import RequestFactory from django.contrib.sessions.middleware import SessionMiddleware -# TODO PLAT-671 Import from Django 1.8 -# from django.utils.translation import LANGUAGE_SESSION_KEY -from django_locale.trans_real import LANGUAGE_SESSION_KEY +from django.utils.translation import LANGUAGE_SESSION_KEY from lang_pref.middleware import LanguagePreferenceMiddleware from openedx.core.djangoapps.user_api.preferences.api import set_user_preference diff --git a/common/djangoapps/monkey_patch/__init__.py b/common/djangoapps/monkey_patch/__init__.py index f718200a98..6c420e94eb 100644 --- a/common/djangoapps/monkey_patch/__init__.py +++ b/common/djangoapps/monkey_patch/__init__.py @@ -13,7 +13,7 @@ made here will affect the entire platform. That said, if you've decided you really need to monkey-patch the platform (and you've convinced enough people that this is best solution), kindly follow these guidelines: - - Reference django_utils_translation.py for a sample implementation. + - Reference django_18_upgrade.py for a sample implementation. - Name your module by replacing periods with underscores for the module to be patched: - patching 'django.utils.translation' diff --git a/common/djangoapps/monkey_patch/django_utils_translation.py b/common/djangoapps/monkey_patch/django_utils_translation.py deleted file mode 100644 index ae1940677c..0000000000 --- a/common/djangoapps/monkey_patch/django_utils_translation.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -Monkey-patch `django.utils.translation` to not dump header info - -Modify Django's translation module, such that the *gettext functions -always return an empty string when attempting to translate an empty -string. This overrides the default behavior [0]: -> It is convention with GNU gettext to include meta-data as the -> translation for the empty string. - -Affected Methods: - - gettext - - ugettext - -Note: The *ngettext and *pgettext functions are intentionally omitted, -as they already behave as expected. The *_lazy functions are implicitly -patched, as they wrap their nonlazy equivalents. - -Django's translation module contains a good deal of indirection. For us -to patch the module with our own functions, we have to patch -`django.utils.translation._trans`. This ensures that the patched -behavior will still be used, even if code elsewhere caches a reference -to one of the translation functions. If you're curious, check out -Django's source code [1]. - -[0] https://docs.python.org/2.7/library/gettext.html#the-gnutranslations-class -[1] https://github.com/django/django/blob/1.4.8/django/utils/translation/__init__.py#L66 -""" -from django.utils.translation import _trans as translation - -import monkey_patch - -ATTRIBUTES = [ - 'gettext', - 'ugettext', -] - - -def is_patched(): - """ - Check if the translation module has been monkey-patched - """ - patched = True - for attribute in ATTRIBUTES: - if not monkey_patch.is_patched(translation, attribute): - patched = False - break - return patched - - -def patch(): - """ - Monkey-patch the translation functions - - Affected Methods: - - gettext - - ugettext - """ - def decorate(function, message_default=u''): - """ - Decorate a translation function - - Default message is a unicode string, but gettext overrides this - value to return a UTF8 string. - """ - def dont_translate_empty_string(message): - """ - Return the empty string when passed a falsey message - """ - if message: - message = function(message) - else: - message = message_default - return message - return dont_translate_empty_string - gettext = decorate(translation.gettext, '') - ugettext = decorate(translation.ugettext) - monkey_patch.patch(translation, 'gettext', gettext) - monkey_patch.patch(translation, 'ugettext', ugettext) - return is_patched() - - -def unpatch(): - """ - Un-monkey-patch the translation functions - """ - was_patched = False - for name in ATTRIBUTES: - # was_patched must be the second half of the or-clause, to avoid - # short-circuiting the expression - was_patched = monkey_patch.unpatch(translation, name) or was_patched - return was_patched diff --git a/common/djangoapps/monkey_patch/tests/test_django_utils_translation.py b/common/djangoapps/monkey_patch/tests/test_django_utils_translation.py deleted file mode 100644 index 109d2a40f0..0000000000 --- a/common/djangoapps/monkey_patch/tests/test_django_utils_translation.py +++ /dev/null @@ -1,337 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Test methods exposed in common/lib/monkey_patch/django_utils_translation.py - -Verify that the Django translation functions (gettext, ngettext, -pgettext, ugettext, and derivatives) all return the correct values -before, during, and after monkey-patching the django.utils.translation -module. - -gettext, ngettext, pgettext, and ugettext must return a translation as -output for nonempty input. - -ngettext, pgettext, npgettext, and ungettext must return an empty string -for an empty string as input. - -gettext and ugettext will return translation headers, before and after -patching. - -gettext and ugettext must return the empty string for any falsey input, -while patched. - -*_noop must return the input text. - -*_lazy must return the same text as their non-lazy counterparts. -""" -# pylint: disable=invalid-name -# Let names like `gettext_*` stay lowercase; makes matching easier. -# pylint: disable=missing-docstring -# All major functions are documented, the rest are self-evident shells. -# pylint: disable=no-member -# Pylint doesn't see our decorator `translate_with` add the `_` method. -# pylint: disable=test-inherits-tests -# This test file intentionally defines one base test class (UgettextTest) and -# patches the gettext function under test for all subsequent inheriting classes. -from unittest import TestCase - -from ddt import data -from ddt import ddt -from django.utils.translation import _trans -from django.utils.translation import gettext -from django.utils.translation import gettext_lazy -from django.utils.translation import gettext_noop -from django.utils.translation import ngettext -from django.utils.translation import ngettext_lazy -from django.utils.translation import npgettext -from django.utils.translation import npgettext_lazy -from django.utils.translation import pgettext -from django.utils.translation import pgettext_lazy -from django.utils.translation import ugettext -from django.utils.translation import ugettext_lazy -from django.utils.translation import ugettext_noop -from django.utils.translation import ungettext -from django.utils.translation import ungettext_lazy - -from monkey_patch.django_utils_translation import ATTRIBUTES as attributes_patched -from monkey_patch.django_utils_translation import is_patched -from monkey_patch.django_utils_translation import patch -from monkey_patch.django_utils_translation import unpatch - -# Note: The commented-out function names are explicitly excluded, as -# they are not attributes of `django.utils.translation._trans`. -# https://github.com/django/django/blob/1.4.8/django/utils/translation/__init__.py#L69 -attributes_not_patched = [ - 'gettext_noop', - 'ngettext', - 'npgettext', - 'pgettext', - 'ungettext', - # 'gettext_lazy', - # 'ngettext_lazy', - # 'npgettext_lazy', - # 'pgettext_lazy', - # 'ugettext_lazy', - # 'ugettext_noop', - # 'ungettext_lazy', -] - - -class MonkeyPatchTest(TestCase): - def setUp(self): - """ - Remember the current state, then reset - """ - super(MonkeyPatchTest, self).setUp() - self.was_patched = unpatch() - self.unpatch_all() - self.addCleanup(self.cleanup) - - def cleanup(self): - """ - Revert translation functions to previous state - - Since the end state varies, we always unpatch to remove any - changes, then repatch again iff the module was already - patched when the test began. - """ - self.unpatch_all() - if self.was_patched: - patch() - - def unpatch_all(self): - """ - Unpatch the module recursively - """ - while is_patched(): - unpatch() - - -@ddt -class PatchTest(MonkeyPatchTest): - """ - Verify monkey-patching and un-monkey-patching - """ - @data(*attributes_not_patched) - def test_not_patch(self, attribute_name): - """ - Test that functions are not patched unintentionally - """ - self.unpatch_all() - old_attribute = getattr(_trans, attribute_name) - patch() - new_attribute = getattr(_trans, attribute_name) - self.assertIs(old_attribute, new_attribute) - - @data(*attributes_patched) - def test_unpatch(self, attribute): - """ - Test that unpatch gracefully handles unpatched functions - """ - patch() - self.assertTrue(is_patched()) - self.unpatch_all() - self.assertFalse(is_patched()) - old_attribute = getattr(_trans, attribute) - self.unpatch_all() - new_attribute = getattr(_trans, attribute) - self.assertIs(old_attribute, new_attribute) - self.assertFalse(is_patched()) - - @data(*attributes_patched) - def test_patch_attributes(self, attribute): - """ - Test that patch changes the attribute - """ - self.unpatch_all() - self.assertFalse(is_patched()) - old_attribute = getattr(_trans, attribute) - patch() - new_attribute = getattr(_trans, attribute) - self.assertIsNot(old_attribute, new_attribute) - self.assertTrue(is_patched()) - old_attribute = getattr(_trans, attribute) - patch() - new_attribute = getattr(_trans, attribute) - self.assertIsNot(old_attribute, new_attribute) - self.assertTrue(is_patched()) - - -def translate_with(function): - """ - Decorate a class by setting its `_` translation function - """ - def decorate(cls): - def _(self, *args): - # pylint: disable=unused-argument - return function(*args) - cls._ = _ - return cls - return decorate - - -@translate_with(ugettext) -class UgettextTest(MonkeyPatchTest): - """ - Test a Django translation function - - Here we consider `ugettext` to be the base/default case. All other - translation functions extend, as needed. - """ - is_unicode = True - needs_patched = True - header = 'Project-Id-Version: ' - - def setUp(self): - """ - Restore translation text and functions - """ - super(UgettextTest, self).setUp() - if self.is_unicode: - self.empty = u'' - self.nonempty = u'(╯°□°)╯︵ ┻━┻' - else: - self.empty = '' - self.nonempty = 'Hey! Where are you?!' - - def assert_translations(self): - """ - Assert that the empty and nonempty translations are correct - - The `empty = empty[:]` syntax is intentional. Since subclasses - may implement a lazy translation, we must perform a "string - operation" to coerce it to a string value. We don't use `str` or - `unicode` because we also assert the string type. - """ - empty, nonempty = self.get_translations() - empty = empty[:] - nonempty = nonempty[:] - if self.is_unicode: - self.assertTrue(isinstance(empty, unicode)) - self.assertTrue(isinstance(nonempty, unicode)) - else: - self.assertTrue(isinstance(empty, str)) - self.assertTrue(isinstance(nonempty, str)) - if self.needs_patched and not is_patched(): - self.assertIn(self.header, empty) - else: - self.assertNotIn(self.header, empty) - self.assertNotIn(self.header, nonempty) - - def get_translations(self): - """ - Translate the empty and nonempty strings, per `self._` - """ - empty = self._(self.empty) - nonempty = self._(self.nonempty) - return (empty, nonempty) - - def test_patch(self): - """ - Test that `self._` correctly translates text before, during, and - after being monkey-patched. - """ - self.assert_translations() - was_successful = patch() - self.assertTrue(was_successful) - self.assert_translations() - was_successful = unpatch() - self.assertTrue(was_successful) - self.assert_translations() - - -@translate_with(gettext) -class GettextTest(UgettextTest): - is_unicode = False - - -@translate_with(pgettext) -class PgettextTest(UgettextTest): - needs_patched = False - l18n_context = 'monkey_patch' - - def get_translations(self): - empty = self._(self.l18n_context, self.empty) - nonempty = self._(self.l18n_context, self.nonempty) - return (empty, nonempty) - - -@translate_with(ngettext) -class NgettextTest(GettextTest): - number = 1 - needs_patched = False - - def get_translations(self): - empty = self._(self.empty, self.empty, self.number) - nonempty = self._(self.nonempty, self.nonempty, self.number) - return (empty, nonempty) - - -@translate_with(npgettext) -class NpgettextTest(PgettextTest): - number = 1 - - def get_translations(self): - empty = self._(self.l18n_context, self.empty, self.empty, self.number) - nonempty = self._(self.l18n_context, self.nonempty, self.nonempty, self.number) - return (empty, nonempty) - - -class NpgettextPluralTest(NpgettextTest): - number = 2 - - -class NgettextPluralTest(NgettextTest): - number = 2 - - -@translate_with(gettext_noop) -class GettextNoopTest(GettextTest): - needs_patched = False - - -@translate_with(ugettext_noop) -class UgettextNoopTest(UgettextTest): - needs_patched = False - - -@translate_with(ungettext) -class UngettextTest(NgettextTest): - is_unicode = True - - -class UngettextPluralTest(UngettextTest): - number = 2 - - -@translate_with(gettext_lazy) -class GettextLazyTest(GettextTest): - pass - - -@translate_with(ugettext_lazy) -class UgettextLazyTest(UgettextTest): - pass - - -@translate_with(pgettext_lazy) -class PgettextLazyTest(PgettextTest): - pass - - -@translate_with(ngettext_lazy) -class NgettextLazyTest(NgettextTest): - pass - - -@translate_with(npgettext_lazy) -class NpgettextLazyTest(NpgettextTest): - pass - - -class NpgettextLazyPluralTest(NpgettextLazyTest): - number = 2 - - -@translate_with(ungettext_lazy) -class UngettextLazyTest(UngettextTest): - pass diff --git a/common/djangoapps/monkey_patch/third_party_auth.py b/common/djangoapps/monkey_patch/third_party_auth.py new file mode 100644 index 0000000000..a78f832907 --- /dev/null +++ b/common/djangoapps/monkey_patch/third_party_auth.py @@ -0,0 +1,38 @@ +""" +Monkey patch implementation for a python_social_auth Django ORM method that is not Django 1.8-compatible. +Remove once the module fully supports Django 1.8! +""" + +from django.db import transaction +from social.storage.django_orm import DjangoUserMixin +from social.apps.django_app.default.models import ( + UserSocialAuth, Nonce, Association, Code +) + + +def patch(): + """ + Monkey-patch the DjangoUserMixin class. + """ + def create_social_auth_wrapper(wrapped_func): + # pylint: disable=missing-docstring + wrapped_func = wrapped_func.__func__ + + def _create_social_auth(*args, **kwargs): + # The entire reason for this monkey-patch is to wrap the create_social_auth call + # in an atomic transaction. The call can sometime raise an IntegrityError, which is + # caught and dealt with by python_social_auth - but not inside of an atomic transaction. + # In Django 1.8, unless the exception is raised in an atomic transaction, the transaction + # becomes unusable after the IntegrityError exception is raised. + with transaction.atomic(): + return wrapped_func(*args, **kwargs) + return classmethod(_create_social_auth) + + DjangoUserMixin.create_social_auth = create_social_auth_wrapper(DjangoUserMixin.create_social_auth) + + # Monkey-patch some social auth models' Meta class to squelch Django19 warnings. + # pylint: disable=protected-access + UserSocialAuth._meta.app_label = "default" + Nonce._meta.app_label = "default" + Association._meta.app_label = "default" + Code._meta.app_label = "default" diff --git a/common/djangoapps/performance/views/__init__.py b/common/djangoapps/performance/views/__init__.py index 805e2d96cb..78fe4e35cf 100644 --- a/common/djangoapps/performance/views/__init__.py +++ b/common/djangoapps/performance/views/__init__.py @@ -19,9 +19,11 @@ def _get_request_header(request, header_name, default=''): def _get_request_value(request, value_name, default=''): - """Helper method to get header values from a request's REQUEST dict, if present.""" - if request is not None and hasattr(request, 'REQUEST') and value_name in request.REQUEST: - return request.REQUEST[value_name] + """Helper method to get header values from a request's GET or POST dicts, if present.""" + if request is not None and hasattr(request, 'GET') and value_name in request.GET: + return request.GET[value_name] + elif request is not None and hasattr(request, 'POST') and value_name in request.POST: + return request.POST[value_name] else: return default diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index 6e169f2ed3..88686c4e07 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -51,8 +51,11 @@ except: %> <%def name="include(path)"><% -from django.template.loaders.filesystem import _loader -source, template_path = _loader.load_template_source(path) +from django.conf import settings +from django.template.engine import Engine +from django.template.loaders.filesystem import Loader +engine = Engine(dirs=settings.DEFAULT_TEMPLATE_ENGINE['DIRS']) +source, template_path = Loader(engine).load_template_source(path) %>${source} <%def name="require_module(module_name, class_name)"> diff --git a/common/djangoapps/reverification/migrations/0001_initial.py b/common/djangoapps/reverification/migrations/0001_initial.py deleted file mode 100644 index b68f411893..0000000000 --- a/common/djangoapps/reverification/migrations/0001_initial.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'MidcourseReverificationWindow' - db.create_table('reverification_midcoursereverificationwindow', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)), - ('end_date', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)), - )) - db.send_create_signal('reverification', ['MidcourseReverificationWindow']) - - - def backwards(self, orm): - # Deleting model 'MidcourseReverificationWindow' - db.delete_table('reverification_midcoursereverificationwindow') - - - models = { - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['reverification'] diff --git a/common/djangoapps/reverification/migrations/0002_auto__del_midcoursereverificationwindow.py b/common/djangoapps/reverification/migrations/0002_auto__del_midcoursereverificationwindow.py deleted file mode 100644 index cad4511ed9..0000000000 --- a/common/djangoapps/reverification/migrations/0002_auto__del_midcoursereverificationwindow.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - - def forwards(self, orm): - # Deleting model 'MidcourseReverificationWindow' - db.delete_table('reverification_midcoursereverificationwindow') - - - def backwards(self, orm): - # Adding model 'MidcourseReverificationWindow' - db.create_table('reverification_midcoursereverificationwindow', ( - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('end_date', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)), - ('start_date', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True)), - )) - db.send_create_signal('reverification', ['MidcourseReverificationWindow']) - - - models = { - - } - - complete_apps = ['reverification'] diff --git a/common/djangoapps/service_status/views.py b/common/djangoapps/service_status/views.py index 7233cbdbda..22028d545f 100644 --- a/common/djangoapps/service_status/views.py +++ b/common/djangoapps/service_status/views.py @@ -28,7 +28,7 @@ def celery_status(_): """ stats = celery.control.inspect().stats() or {} return HttpResponse(json.dumps(stats, indent=4), - mimetype="application/json") + content_type="application/json") @dog_stats_api.timed('status.service.celery.ping') @@ -56,4 +56,4 @@ def celery_ping(_): } return HttpResponse(json.dumps(output, indent=4), - mimetype="application/json") + content_type="application/json") diff --git a/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py b/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py index 076204c31e..02e0c2b7b3 100644 --- a/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py +++ b/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py @@ -3,12 +3,12 @@ ### from django.core.management.base import NoArgsCommand -from django.core.cache import get_cache +from django.core.cache import caches class Command(NoArgsCommand): help = 'Import the specified data directory into the default ModuleStore' def handle_noargs(self, **options): - staticfiles_cache = get_cache('staticfiles') + staticfiles_cache = caches['staticfiles'] staticfiles_cache.clear() diff --git a/common/djangoapps/status/migrations/0001_initial.py b/common/djangoapps/status/migrations/0001_initial.py index 48a4d1eeff..7eefeb320c 100644 --- a/common/djangoapps/status/migrations/0001_initial.py +++ b/common/djangoapps/status/migrations/0001_initial.py @@ -1,93 +1,44 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'GlobalStatusMessage' - db.create_table('status_globalstatusmessage', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('message', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('status', ['GlobalStatusMessage']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'CourseMessage' - db.create_table('status_coursemessage', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('global_message', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['status.GlobalStatusMessage'])), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(db_index=True, max_length=255, blank=True)), - ('message', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('status', ['CourseMessage']) - - - def backwards(self, orm): - # Deleting model 'GlobalStatusMessage' - db.delete_table('status_globalstatusmessage') - - # Deleting model 'CourseMessage' - db.delete_table('status_coursemessage') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'status.coursemessage': { - 'Meta': {'object_name': 'CourseMessage'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'global_message': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['status.GlobalStatusMessage']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'status.globalstatusmessage': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'GlobalStatusMessage'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['status'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='CourseMessage', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_key', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), + ('message', models.TextField(null=True, blank=True)), + ], + ), + migrations.CreateModel( + name='GlobalStatusMessage', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('message', models.TextField(null=True, blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.AddField( + model_name='coursemessage', + name='global_message', + field=models.ForeignKey(to='status.GlobalStatusMessage'), + ), + ] diff --git a/common/djangoapps/student/admin.py b/common/djangoapps/student/admin.py index 0f2ad68d27..3b84627837 100644 --- a/common/djangoapps/student/admin.py +++ b/common/djangoapps/student/admin.py @@ -19,6 +19,7 @@ class CourseAccessRoleForm(forms.ModelForm): class Meta(object): model = CourseAccessRole + fields = '__all__' email = forms.EmailField(required=True) COURSE_ACCESS_ROLES = [(role_name, role_name) for role_name in REGISTERED_ACCESS_ROLES.keys()] diff --git a/common/djangoapps/student/forms.py b/common/djangoapps/student/forms.py index 3b4ff7c95d..bf85d55a21 100644 --- a/common/djangoapps/student/forms.py +++ b/common/djangoapps/student/forms.py @@ -2,10 +2,11 @@ Utility functions for validating forms """ from django import forms +from django.forms import widgets from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.contrib.auth.forms import PasswordResetForm -from django.contrib.auth.hashers import UNUSABLE_PASSWORD +from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX from django.contrib.auth.tokens import default_token_generator from django.utils.http import int_to_base36 @@ -22,6 +23,13 @@ from util.password_policy_validators import ( class PasswordResetFormNoActive(PasswordResetForm): + error_messages = { + 'unknown': _("That e-mail address doesn't have an associated " + "user account. Are you sure you've registered?"), + 'unusable': _("The user account associated with this e-mail " + "address cannot reset the password."), + } + def clean_email(self): """ This is a literal copy from Django 1.4.5's django.contrib.auth.forms.PasswordResetForm @@ -33,7 +41,7 @@ class PasswordResetFormNoActive(PasswordResetForm): self.users_cache = User.objects.filter(email__iexact=email) if not len(self.users_cache): raise forms.ValidationError(self.error_messages['unknown']) - if any((user.password == UNUSABLE_PASSWORD) + if any((user.password.startswith(UNUSABLE_PASSWORD_PREFIX)) for user in self.users_cache): raise forms.ValidationError(self.error_messages['unusable']) return email @@ -79,16 +87,20 @@ class PasswordResetFormNoActive(PasswordResetForm): send_mail(subject, email, from_email, [user.email]) +class TrueCheckbox(widgets.CheckboxInput): + """ + A checkbox widget that only accepts "true" (case-insensitive) as true. + """ + def value_from_datadict(self, data, files, name): + value = data.get(name, '') + return value.lower() == 'true' + + class TrueField(forms.BooleanField): """ A boolean field that only accepts "true" (case-insensitive) as true """ - def to_python(self, value): - # CheckboxInput converts string to bool by case-insensitive match to "true" or "false" - if value is True: - return value - else: - return None + widget = TrueCheckbox _USERNAME_TOO_SHORT_MSG = _("Username must be minimum of two characters long") diff --git a/common/djangoapps/student/helpers.py b/common/djangoapps/student/helpers.py index e285e3dcf1..4e882e5dcc 100644 --- a/common/djangoapps/student/helpers.py +++ b/common/djangoapps/student/helpers.py @@ -6,7 +6,7 @@ from pytz import UTC from django.core.urlresolvers import reverse, NoReverseMatch import third_party_auth -from verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification # pylint: disable=import-error +from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification from course_modes.models import CourseMode diff --git a/common/djangoapps/student/management/commands/transfer_students.py b/common/djangoapps/student/management/commands/transfer_students.py index 835d954071..79892cd5a6 100644 --- a/common/djangoapps/student/management/commands/transfer_students.py +++ b/common/djangoapps/student/management/commands/transfer_students.py @@ -52,7 +52,7 @@ class Command(TrackedCommand): help="If True, try to transfer certificate items to the new course.") ) - @transaction.commit_manually + @transaction.atomic def handle(self, *args, **options): # pylint: disable=unused-argument source_key = CourseKey.from_string(options.get('source_course', '')) dest_keys = [] @@ -72,7 +72,7 @@ class Command(TrackedCommand): ) for user in source_students: - with transaction.commit_on_success(): + with transaction.atomic(): print "Moving {}.".format(user.username) # Find the old enrollment. enrollment = CourseEnrollment.objects.get( diff --git a/common/djangoapps/student/migrations/0001_initial.py b/common/djangoapps/student/migrations/0001_initial.py index d5766ca823..9bb87bae63 100644 --- a/common/djangoapps/student/migrations/0001_initial.py +++ b/common/djangoapps/student/migrations/0001_initial.py @@ -1,120 +1,290 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import django_countries.fields +import django.db.models.deletion +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'UserProfile' - db.create_table('auth_userprofile', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)), - ('name', self.gf('django.db.models.fields.TextField')(blank=True)), - ('language', self.gf('django.db.models.fields.TextField')(blank=True)), - ('location', self.gf('django.db.models.fields.TextField')(blank=True)), - ('meta', self.gf('django.db.models.fields.TextField')(blank=True)), - ('courseware', self.gf('django.db.models.fields.TextField')(default='course.xml', blank=True)), - )) - db.send_create_signal('student', ['UserProfile']) - - # Adding model 'Registration' - db.create_table('auth_registration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)), - ('activation_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32, db_index=True)), - )) - db.send_create_signal('student', ['Registration']) - - def backwards(self, orm): - - # Deleting model 'UserProfile' - db.delete_table('auth_userprofile') - - # Deleting model 'Registration' - db.delete_table('auth_registration') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.TextField', [], {'default': "'course.xml'", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - } - } - - complete_apps = ['student'] + operations = [ + migrations.CreateModel( + name='AnonymousUserId', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('anonymous_user_id', models.CharField(unique=True, max_length=32)), + ('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='CourseAccessRole', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('org', models.CharField(db_index=True, max_length=64, blank=True)), + ('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), + ('role', models.CharField(max_length=64, db_index=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='CourseEnrollment', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ('is_active', models.BooleanField(default=True)), + ('mode', models.CharField(default=b'honor', max_length=100)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ('user', 'course_id'), + }, + ), + migrations.CreateModel( + name='CourseEnrollmentAllowed', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('email', models.CharField(max_length=255, db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('auto_enroll', models.BooleanField(default=0)), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ], + ), + migrations.CreateModel( + name='CourseEnrollmentAttribute', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('namespace', models.CharField(help_text='Namespace of enrollment attribute', max_length=255)), + ('name', models.CharField(help_text='Name of the enrollment attribute', max_length=255)), + ('value', models.CharField(help_text='Value of the enrollment attribute', max_length=255)), + ('enrollment', models.ForeignKey(related_name='attributes', to='student.CourseEnrollment')), + ], + ), + migrations.CreateModel( + name='DashboardConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('recent_enrollment_time_delta', models.PositiveIntegerField(default=0, help_text=b"The number of seconds in which a new enrollment is considered 'recent'. Used to display notifications.")), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='EnrollmentRefundConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('refund_window_microseconds', models.BigIntegerField(default=1209600000000, help_text='The window of time after enrolling during which users can be granted a refund, represented in microseconds. The default is 14 days.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='EntranceExamConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ('updated', models.DateTimeField(auto_now=True, db_index=True)), + ('skip_entrance_exam', models.BooleanField(default=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='HistoricalCourseEnrollment', + fields=[ + ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created', models.DateTimeField(db_index=True, null=True, editable=False, blank=True)), + ('is_active', models.BooleanField(default=True)), + ('mode', models.CharField(default=b'honor', max_length=100)), + ('history_id', models.AutoField(serialize=False, primary_key=True)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), + ('history_user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ('user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + 'verbose_name': 'historical course enrollment', + }, + ), + migrations.CreateModel( + name='LanguageProficiency', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('code', models.CharField(help_text='The ISO 639-1 language code for this language.', max_length=16, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokm\xe5l, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volap\xfck'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']])), + ], + ), + migrations.CreateModel( + name='LinkedInAddToProfileConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('company_identifier', models.TextField(help_text='The company identifier for the LinkedIn Add-to-Profile button e.g 0_0dPSPyS070e0HsE9HNz_13_d11_')), + ('dashboard_tracking_code', models.TextField(default=b'', blank=True)), + ('trk_partner_name', models.CharField(default=b'', help_text="Short identifier for the LinkedIn partner used in the tracking code. (Example: 'edx') If no value is provided, tracking codes will not be sent to LinkedIn.", max_length=10, blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LoginFailures', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('failure_count', models.IntegerField(default=0)), + ('lockout_until', models.DateTimeField(null=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ManualEnrollmentAudit', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('enrolled_email', models.CharField(max_length=255, db_index=True)), + ('time_stamp', models.DateTimeField(auto_now_add=True, null=True)), + ('state_transition', models.CharField(max_length=255, choices=[(b'from unenrolled to allowed to enroll', b'from unenrolled to allowed to enroll'), (b'from allowed to enroll to enrolled', b'from allowed to enroll to enrolled'), (b'from enrolled to enrolled', b'from enrolled to enrolled'), (b'from enrolled to unenrolled', b'from enrolled to unenrolled'), (b'from unenrolled to enrolled', b'from unenrolled to enrolled'), (b'from allowed to enroll to enrolled', b'from allowed to enroll to enrolled'), (b'from unenrolled to unenrolled', b'from unenrolled to unenrolled'), (b'N/A', b'N/A')])), + ('reason', models.TextField(null=True)), + ('enrolled_by', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)), + ('enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)), + ], + ), + migrations.CreateModel( + name='PasswordHistory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('password', models.CharField(max_length=128)), + ('time_set', models.DateTimeField(default=django.utils.timezone.now)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='PendingEmailChange', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('new_email', models.CharField(db_index=True, max_length=255, blank=True)), + ('activation_key', models.CharField(unique=True, max_length=32, verbose_name=b'activation key', db_index=True)), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='PendingNameChange', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('new_name', models.CharField(max_length=255, blank=True)), + ('rationale', models.CharField(max_length=1024, blank=True)), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Registration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('activation_key', models.CharField(unique=True, max_length=32, verbose_name=b'activation key', db_index=True)), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'auth_registration', + }, + ), + migrations.CreateModel( + name='UserProfile', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(db_index=True, max_length=255, blank=True)), + ('meta', models.TextField(blank=True)), + ('courseware', models.CharField(default=b'course.xml', max_length=255, blank=True)), + ('language', models.CharField(db_index=True, max_length=255, blank=True)), + ('location', models.CharField(db_index=True, max_length=255, blank=True)), + ('year_of_birth', models.IntegerField(db_index=True, null=True, blank=True)), + ('gender', models.CharField(blank=True, max_length=6, null=True, db_index=True, choices=[(b'm', b'Male'), (b'f', b'Female'), (b'o', b'Other/Prefer Not to Say')])), + ('level_of_education', models.CharField(blank=True, max_length=6, null=True, db_index=True, choices=[(b'p', b'Doctorate'), (b'm', b"Master's or professional degree"), (b'b', b"Bachelor's degree"), (b'a', b'Associate degree'), (b'hs', b'Secondary/high school'), (b'jhs', b'Junior secondary/junior high/middle school'), (b'el', b'Elementary/primary school'), (b'none', b'No Formal Education'), (b'other', b'Other Education')])), + ('mailing_address', models.TextField(null=True, blank=True)), + ('city', models.TextField(null=True, blank=True)), + ('country', django_countries.fields.CountryField(blank=True, max_length=2, null=True)), + ('goals', models.TextField(null=True, blank=True)), + ('allow_certificate', models.BooleanField(default=1)), + ('bio', models.CharField(max_length=3000, null=True, blank=True)), + ('profile_image_uploaded_at', models.DateTimeField(null=True)), + ('user', models.OneToOneField(related_name='profile', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'auth_userprofile', + }, + ), + migrations.CreateModel( + name='UserSignupSource', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('site', models.CharField(max_length=255, db_index=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='UserStanding', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('account_status', models.CharField(blank=True, max_length=31, choices=[(b'disabled', 'Account Disabled'), (b'enabled', 'Account Enabled')])), + ('standing_last_changed_at', models.DateTimeField(auto_now=True)), + ('changed_by', models.ForeignKey(to=settings.AUTH_USER_MODEL, blank=True)), + ('user', models.OneToOneField(related_name='standing', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='UserTestGroup', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=32, db_index=True)), + ('description', models.TextField(blank=True)), + ('users', models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_index=True)), + ], + ), + migrations.AddField( + model_name='languageproficiency', + name='user_profile', + field=models.ForeignKey(related_name='language_proficiencies', to='student.UserProfile'), + ), + migrations.AlterUniqueTogether( + name='courseenrollmentallowed', + unique_together=set([('email', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='languageproficiency', + unique_together=set([('code', 'user_profile')]), + ), + migrations.AlterUniqueTogether( + name='entranceexamconfiguration', + unique_together=set([('user', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='courseenrollment', + unique_together=set([('user', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='courseaccessrole', + unique_together=set([('user', 'org', 'course_id', 'role')]), + ), + ] diff --git a/common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py b/common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py deleted file mode 100644 index 27aea40a5c..0000000000 --- a/common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py +++ /dev/null @@ -1,142 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'UserProfile.name' - db.alter_column('auth_userprofile', 'name', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Adding index on 'UserProfile', fields ['name'] - db.create_index('auth_userprofile', ['name']) - - # Changing field 'UserProfile.language' - db.alter_column('auth_userprofile', 'language', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Adding index on 'UserProfile', fields ['language'] - db.create_index('auth_userprofile', ['language']) - - # Changing field 'UserProfile.courseware' - db.alter_column('auth_userprofile', 'courseware', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Changing field 'UserProfile.location' - db.alter_column('auth_userprofile', 'location', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Adding index on 'UserProfile', fields ['location'] - db.create_index('auth_userprofile', ['location']) - - def backwards(self, orm): - - # Removing index on 'UserProfile', fields ['location'] - db.delete_index('auth_userprofile', ['location']) - - # Removing index on 'UserProfile', fields ['language'] - db.delete_index('auth_userprofile', ['language']) - - # Removing index on 'UserProfile', fields ['name'] - db.delete_index('auth_userprofile', ['name']) - - # Changing field 'UserProfile.name' - db.alter_column('auth_userprofile', 'name', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'UserProfile.language' - db.alter_column('auth_userprofile', 'language', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'UserProfile.courseware' - db.alter_column('auth_userprofile', 'courseware', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'UserProfile.location' - db.alter_column('auth_userprofile', 'location', self.gf('django.db.models.fields.TextField')()) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py b/common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py deleted file mode 100644 index a63abf9469..0000000000 --- a/common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py +++ /dev/null @@ -1,123 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'UserTestGroup' - db.create_table('student_usertestgroup', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('description', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('student', ['UserTestGroup']) - - # Adding M2M table for field users on 'UserTestGroup' - db.create_table('student_usertestgroup_users', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('usertestgroup', models.ForeignKey(orm['student.usertestgroup'], null=False)), - ('user', models.ForeignKey(orm['auth.user'], null=False)) - )) - db.create_unique('student_usertestgroup_users', ['usertestgroup_id', 'user_id']) - - def backwards(self, orm): - - # Deleting model 'UserTestGroup' - db.delete_table('student_usertestgroup') - - # Removing M2M table for field users on 'UserTestGroup' - db.delete_table('student_usertestgroup_users') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0004_add_email_index.py b/common/djangoapps/student/migrations/0004_add_email_index.py deleted file mode 100644 index 60af424f65..0000000000 --- a/common/djangoapps/student/migrations/0004_add_email_index.py +++ /dev/null @@ -1,105 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - db.execute("create unique index email on auth_user (email)") - pass - - def backwards(self, orm): - db.execute("drop index email on auth_user") - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0005_name_change.py b/common/djangoapps/student/migrations/0005_name_change.py deleted file mode 100644 index 24c393ccce..0000000000 --- a/common/djangoapps/student/migrations/0005_name_change.py +++ /dev/null @@ -1,145 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'PendingEmailChange' - db.create_table('student_pendingemailchange', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), - ('new_email', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, blank=True)), - ('activation_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32, db_index=True)), - )) - db.send_create_signal('student', ['PendingEmailChange']) - - # Adding model 'PendingNameChange' - db.create_table('student_pendingnamechange', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), - ('new_name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('rationale', self.gf('django.db.models.fields.CharField')(max_length=1024, blank=True)), - )) - db.send_create_signal('student', ['PendingNameChange']) - - # Changing field 'UserProfile.user' - db.alter_column('auth_userprofile', 'user_id', self.gf('django.db.models.fields.related.OneToOneField')(unique=True, to=orm['auth.User'])) - - def backwards(self, orm): - - # Deleting model 'PendingEmailChange' - db.delete_table('student_pendingemailchange') - - # Deleting model 'PendingNameChange' - db.delete_table('student_pendingnamechange') - - # Changing field 'UserProfile.user' - db.alter_column('auth_userprofile', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0006_expand_meta_field.py b/common/djangoapps/student/migrations/0006_expand_meta_field.py deleted file mode 100644 index 7fc3094ccc..0000000000 --- a/common/djangoapps/student/migrations/0006_expand_meta_field.py +++ /dev/null @@ -1,121 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.TextField')()) - - def backwards(self, orm): - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0007_convert_to_utf8.py b/common/djangoapps/student/migrations/0007_convert_to_utf8.py deleted file mode 100644 index 7a96496ad0..0000000000 --- a/common/djangoapps/student/migrations/0007_convert_to_utf8.py +++ /dev/null @@ -1,125 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - if db.backend_name == 'mysql': - db.execute_many(""" - ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci; - ALTER TABLE student_pendingemailchange CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; - ALTER TABLE student_pendingnamechange CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; - ALTER TABLE student_usertestgroup CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; - ALTER TABLE student_usertestgroup_users CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; - """) - - def backwards(self, orm): - # Although this migration can't be undone, it is okay for it to be run backwards because it doesn't add/remove any fields - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0008__auto__add_courseregistration.py b/common/djangoapps/student/migrations/0008__auto__add_courseregistration.py deleted file mode 100644 index 22ef55913a..0000000000 --- a/common/djangoapps/student/migrations/0008__auto__add_courseregistration.py +++ /dev/null @@ -1,130 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseRegistration' - db.create_table('student_courseregistration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), - ('course_id', self.gf('django.db.models.fields.IntegerField')()), - )) - db.send_create_signal('student', ['CourseRegistration']) - - def backwards(self, orm): - # Deleting model 'CourseRegistration' - db.delete_table('student_courseregistration') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseregistration': { - 'Meta': {'object_name': 'CourseRegistration'}, - 'course_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py b/common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py deleted file mode 100644 index c5af13d34c..0000000000 --- a/common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py +++ /dev/null @@ -1,141 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'CourseRegistration' - db.delete_table('student_courseregistration') - - # Adding model 'CourseEnrollment' - db.create_table('student_courseenrollment', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), - ('course_id', self.gf('django.db.models.fields.IntegerField')()), - )) - db.send_create_signal('student', ['CourseEnrollment']) - - def backwards(self, orm): - # Adding model 'CourseRegistration' - db.create_table('student_courseregistration', ( - ('course_id', self.gf('django.db.models.fields.IntegerField')()), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), - )) - db.send_create_signal('student', ['CourseRegistration']) - - # Deleting model 'CourseEnrollment' - db.delete_table('student_courseenrollment') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0010_auto__chg_field_courseenrollment_course_id.py b/common/djangoapps/student/migrations/0010_auto__chg_field_courseenrollment_course_id.py deleted file mode 100644 index 153a166b5e..0000000000 --- a/common/djangoapps/student/migrations/0010_auto__chg_field_courseenrollment_course_id.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'CourseEnrollment.course_id' - db.alter_column('student_courseenrollment', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - def backwards(self, orm): - - # Changing field 'CourseEnrollment.course_id' - db.alter_column('student_courseenrollment', 'course_id', self.gf('django.db.models.fields.IntegerField')()) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py b/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py deleted file mode 100644 index e8417f53ef..0000000000 --- a/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py +++ /dev/null @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # This table is dropped in a subsequent migration. This migration was causing problems when using InnoDB, - # so we are just dropping it. - pass - # # Removing unique constraint on 'CourseEnrollment', fields ['user'] - # db.delete_unique('student_courseenrollment', ['user_id']) - # - # - # # Changing field 'CourseEnrollment.user' - # db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])) - - def backwards(self, orm): - pass - # # Changing field 'CourseEnrollment.user' - # db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)) - # # Adding unique constraint on 'CourseEnrollment', fields ['user'] - # db.create_unique('student_courseenrollment', ['user_id']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0012_auto__add_field_userprofile_gender__add_field_userprofile_date_of_birt.py b/common/djangoapps/student/migrations/0012_auto__add_field_userprofile_gender__add_field_userprofile_date_of_birt.py deleted file mode 100644 index ce46bf50fa..0000000000 --- a/common/djangoapps/student/migrations/0012_auto__add_field_userprofile_gender__add_field_userprofile_date_of_birt.py +++ /dev/null @@ -1,173 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'UserProfile.gender' - db.add_column('auth_userprofile', 'gender', - self.gf('django.db.models.fields.CharField')(max_length=6, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.date_of_birth' - db.add_column('auth_userprofile', 'date_of_birth', - self.gf('django.db.models.fields.DateField')(null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.mailing_address' - db.add_column('auth_userprofile', 'mailing_address', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.country' - db.add_column('auth_userprofile', 'country', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.telephone_number' - db.add_column('auth_userprofile', 'telephone_number', - self.gf('django.db.models.fields.CharField')(max_length=25, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.occupation' - db.add_column('auth_userprofile', 'occupation', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'UserProfile.gender' - db.delete_column('auth_userprofile', 'gender') - - # Deleting field 'UserProfile.date_of_birth' - db.delete_column('auth_userprofile', 'date_of_birth') - - # Deleting field 'UserProfile.mailing_address' - db.delete_column('auth_userprofile', 'mailing_address') - - # Deleting field 'UserProfile.country' - db.delete_column('auth_userprofile', 'country') - - # Deleting field 'UserProfile.telephone_number' - db.delete_column('auth_userprofile', 'telephone_number') - - # Deleting field 'UserProfile.occupation' - db.delete_column('auth_userprofile', 'occupation') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0013_auto__chg_field_userprofile_meta.py b/common/djangoapps/student/migrations/0013_auto__chg_field_userprofile_meta.py deleted file mode 100644 index de81c6bf53..0000000000 --- a/common/djangoapps/student/migrations/0013_auto__chg_field_userprofile_meta.py +++ /dev/null @@ -1,133 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.TextField')()) - - def backwards(self, orm): - - # Changing field 'UserProfile.meta' - db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0014_auto__del_courseenrollment.py b/common/djangoapps/student/migrations/0014_auto__del_courseenrollment.py deleted file mode 100644 index 926c38c55f..0000000000 --- a/common/djangoapps/student/migrations/0014_auto__del_courseenrollment.py +++ /dev/null @@ -1,130 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'CourseEnrollment' - db.delete_table('student_courseenrollment') - - def backwards(self, orm): - # Adding model 'CourseEnrollment' - db.create_table('student_courseenrollment', ( - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - )) - db.send_create_signal('student', ['CourseEnrollment']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0015_auto__add_courseenrollment__add_unique_courseenrollment_user_course_id.py b/common/djangoapps/student/migrations/0015_auto__add_courseenrollment__add_unique_courseenrollment_user_course_id.py deleted file mode 100644 index 3cde0c755c..0000000000 --- a/common/djangoapps/student/migrations/0015_auto__add_courseenrollment__add_unique_courseenrollment_user_course_id.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseEnrollment' - db.create_table('student_courseenrollment', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('student', ['CourseEnrollment']) - - # Adding unique constraint on 'CourseEnrollment', fields ['user', 'course_id'] - db.create_unique('student_courseenrollment', ['user_id', 'course_id']) - - def backwards(self, orm): - # Removing unique constraint on 'CourseEnrollment', fields ['user', 'course_id'] - db.delete_unique('student_courseenrollment', ['user_id', 'course_id']) - - # Deleting model 'CourseEnrollment' - db.delete_table('student_courseenrollment') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py b/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py deleted file mode 100644 index 58f013742e..0000000000 --- a/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py +++ /dev/null @@ -1,140 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseEnrollment.date' - db.add_column('student_courseenrollment', 'date', - self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), - keep_default=False) - - # Changing field 'UserProfile.country' - db.alter_column('auth_userprofile', 'country', self.gf('django_countries.fields.CountryField')(max_length=2, null=True)) - - def backwards(self, orm): - # Deleting field 'CourseEnrollment.date' - db.delete_column('student_courseenrollment', 'date') - - # Changing field 'UserProfile.country' - db.alter_column('auth_userprofile', 'country', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0017_rename_date_to_created.py b/common/djangoapps/student/migrations/0017_rename_date_to_created.py deleted file mode 100644 index 6bde313d8b..0000000000 --- a/common/djangoapps/student/migrations/0017_rename_date_to_created.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Rename 'date' field to 'created' - db.rename_column('student_courseenrollment', 'date', 'created') - - def backwards(self, orm): - # Rename 'created' field to 'date' - db.rename_column('student_courseenrollment', 'created', 'date') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0018_auto.py b/common/djangoapps/student/migrations/0018_auto.py deleted file mode 100644 index df0cc3fbdb..0000000000 --- a/common/djangoapps/student/migrations/0018_auto.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding index on 'CourseEnrollment', fields ['created'] - db.create_index('student_courseenrollment', ['created']) - - def backwards(self, orm): - # Removing index on 'CourseEnrollment', fields ['created'] - db.delete_index('student_courseenrollment', ['created']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0019_create_approved_demographic_fields_fall_2012.py b/common/djangoapps/student/migrations/0019_create_approved_demographic_fields_fall_2012.py deleted file mode 100644 index 7c0207f4f4..0000000000 --- a/common/djangoapps/student/migrations/0019_create_approved_demographic_fields_fall_2012.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'UserProfile.occupation' - db.delete_column('auth_userprofile', 'occupation') - - # Deleting field 'UserProfile.telephone_number' - db.delete_column('auth_userprofile', 'telephone_number') - - # Deleting field 'UserProfile.date_of_birth' - db.delete_column('auth_userprofile', 'date_of_birth') - - # Deleting field 'UserProfile.country' - db.delete_column('auth_userprofile', 'country') - - # Adding field 'UserProfile.year_of_birth' - db.add_column('auth_userprofile', 'year_of_birth', - self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.level_of_education' - db.add_column('auth_userprofile', 'level_of_education', - self.gf('django.db.models.fields.CharField')(db_index=True, max_length=6, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.goals' - db.add_column('auth_userprofile', 'goals', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - # Adding index on 'UserProfile', fields ['gender'] - db.create_index('auth_userprofile', ['gender']) - - def backwards(self, orm): - # Removing index on 'UserProfile', fields ['gender'] - db.delete_index('auth_userprofile', ['gender']) - - # Adding field 'UserProfile.occupation' - db.add_column('auth_userprofile', 'occupation', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.telephone_number' - db.add_column('auth_userprofile', 'telephone_number', - self.gf('django.db.models.fields.CharField')(max_length=25, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.date_of_birth' - db.add_column('auth_userprofile', 'date_of_birth', - self.gf('django.db.models.fields.DateField')(null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.country' - db.add_column('auth_userprofile', 'country', - self.gf('django_countries.fields.CountryField')(max_length=2, null=True, blank=True), - keep_default=False) - - # Deleting field 'UserProfile.year_of_birth' - db.delete_column('auth_userprofile', 'year_of_birth') - - # Deleting field 'UserProfile.level_of_education' - db.delete_column('auth_userprofile', 'level_of_education') - - # Deleting field 'UserProfile.goals' - db.delete_column('auth_userprofile', 'goals') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0020_add_test_center_user.py b/common/djangoapps/student/migrations/0020_add_test_center_user.py deleted file mode 100644 index 6c0bf5c4ee..0000000000 --- a/common/djangoapps/student/migrations/0020_add_test_center_user.py +++ /dev/null @@ -1,188 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'TestCenterUser' - db.create_table('student_testcenteruser', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['auth.User'], unique=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - ('user_updated_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('candidate_id', self.gf('django.db.models.fields.IntegerField')(null=True, db_index=True)), - ('client_candidate_id', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('first_name', self.gf('django.db.models.fields.CharField')(max_length=30, db_index=True)), - ('last_name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('middle_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)), - ('suffix', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('salutation', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)), - ('address_1', self.gf('django.db.models.fields.CharField')(max_length=40)), - ('address_2', self.gf('django.db.models.fields.CharField')(max_length=40, blank=True)), - ('address_3', self.gf('django.db.models.fields.CharField')(max_length=40, blank=True)), - ('city', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('state', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=20, blank=True)), - ('postal_code', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=16, blank=True)), - ('country', self.gf('django.db.models.fields.CharField')(max_length=3, db_index=True)), - ('phone', self.gf('django.db.models.fields.CharField')(max_length=35)), - ('extension', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=8, blank=True)), - ('phone_country_code', self.gf('django.db.models.fields.CharField')(max_length=3, db_index=True)), - ('fax', self.gf('django.db.models.fields.CharField')(max_length=35, blank=True)), - ('fax_country_code', self.gf('django.db.models.fields.CharField')(max_length=3, blank=True)), - ('company_name', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)), - )) - db.send_create_signal('student', ['TestCenterUser']) - - - def backwards(self, orm): - # Deleting model 'TestCenterUser' - db.delete_table('student_testcenteruser') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0021_remove_askbot.py b/common/djangoapps/student/migrations/0021_remove_askbot.py deleted file mode 100644 index 8f76e5078c..0000000000 --- a/common/djangoapps/student/migrations/0021_remove_askbot.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -ASKBOT_AUTH_USER_COLUMNS = ( - 'website', - 'about', - 'gold', - 'email_isvalid', - 'real_name', - 'location', - 'reputation', - 'gravatar', - 'bronze', - 'last_seen', - 'silver', - 'questions_per_page', - 'new_response_count', - 'seen_response_count', -) - - -class Migration(SchemaMigration): - - def forwards(self, orm): - "Kill the askbot" - try: - # For MySQL, we're batching the alters together for performance reasons - if db.backend_name == 'mysql': - drops = ["drop `{0}`".format(col) for col in ASKBOT_AUTH_USER_COLUMNS] - statement = "alter table `auth_user` {0};".format(", ".join(drops)) - db.execute(statement) - else: - for column in ASKBOT_AUTH_USER_COLUMNS: - db.delete_column('auth_user', column) - except Exception as ex: - print "Couldn't remove askbot because of {0} -- it was probably never here to begin with.".format(ex) - - def backwards(self, orm): - raise RuntimeError("Cannot reverse this migration: there's no going back to Askbot.") - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0022_auto__add_courseenrollmentallowed__add_unique_courseenrollmentallowed_.py b/common/djangoapps/student/migrations/0022_auto__add_courseenrollmentallowed__add_unique_courseenrollmentallowed_.py deleted file mode 100644 index 769ad6737d..0000000000 --- a/common/djangoapps/student/migrations/0022_auto__add_courseenrollmentallowed__add_unique_courseenrollmentallowed_.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseEnrollmentAllowed' - db.create_table('student_courseenrollmentallowed', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('email', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, db_index=True, blank=True)), - )) - db.send_create_signal('student', ['CourseEnrollmentAllowed']) - - # Adding unique constraint on 'CourseEnrollmentAllowed', fields ['email', 'course_id'] - db.create_unique('student_courseenrollmentallowed', ['email', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseEnrollmentAllowed', fields ['email', 'course_id'] - db.delete_unique('student_courseenrollmentallowed', ['email', 'course_id']) - - # Deleting model 'CourseEnrollmentAllowed' - db.delete_table('student_courseenrollmentallowed') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0023_add_test_center_registration.py b/common/djangoapps/student/migrations/0023_add_test_center_registration.py deleted file mode 100644 index 6186f5deef..0000000000 --- a/common/djangoapps/student/migrations/0023_add_test_center_registration.py +++ /dev/null @@ -1,241 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'TestCenterRegistration' - db.create_table('student_testcenterregistration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('testcenter_user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['student.TestCenterUser'])), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - ('user_updated_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('client_authorization_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20, db_index=True)), - ('exam_series_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), - ('eligibility_appointment_date_first', self.gf('django.db.models.fields.DateField')(db_index=True)), - ('eligibility_appointment_date_last', self.gf('django.db.models.fields.DateField')(db_index=True)), - ('accommodation_code', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('accommodation_request', self.gf('django.db.models.fields.CharField')(db_index=False, max_length=1024, blank=True)), - ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('processed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('upload_status', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=20, blank=True)), - ('upload_error_message', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)), - ('authorization_id', self.gf('django.db.models.fields.IntegerField')(null=True, db_index=True)), - ('confirmed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - )) - db.send_create_signal('student', ['TestCenterRegistration']) - - # Adding field 'TestCenterUser.uploaded_at' - db.add_column('student_testcenteruser', 'uploaded_at', - self.gf('django.db.models.fields.DateTimeField')(db_index=True, null=True, blank=True), - keep_default=False) - - # Adding field 'TestCenterUser.processed_at' - db.add_column('student_testcenteruser', 'processed_at', - self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True), - keep_default=False) - - # Adding field 'TestCenterUser.upload_status' - db.add_column('student_testcenteruser', 'upload_status', - self.gf('django.db.models.fields.CharField')(db_index=True, default='', max_length=20, blank=True), - keep_default=False) - - # Adding field 'TestCenterUser.upload_error_message' - db.add_column('student_testcenteruser', 'upload_error_message', - self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True), - keep_default=False) - - # Adding field 'TestCenterUser.confirmed_at' - db.add_column('student_testcenteruser', 'confirmed_at', - self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True), - keep_default=False) - - # Adding index on 'TestCenterUser', fields ['company_name'] - db.create_index('student_testcenteruser', ['company_name']) - - # Adding unique constraint on 'TestCenterUser', fields ['client_candidate_id'] - db.create_unique('student_testcenteruser', ['client_candidate_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'TestCenterUser', fields ['client_candidate_id'] - db.delete_unique('student_testcenteruser', ['client_candidate_id']) - - # Removing index on 'TestCenterUser', fields ['company_name'] - db.delete_index('student_testcenteruser', ['company_name']) - - # Deleting model 'TestCenterRegistration' - db.delete_table('student_testcenterregistration') - - # Deleting field 'TestCenterUser.uploaded_at' - db.delete_column('student_testcenteruser', 'uploaded_at') - - # Deleting field 'TestCenterUser.processed_at' - db.delete_column('student_testcenteruser', 'processed_at') - - # Deleting field 'TestCenterUser.upload_status' - db.delete_column('student_testcenteruser', 'upload_status') - - # Deleting field 'TestCenterUser.upload_error_message' - db.delete_column('student_testcenteruser', 'upload_error_message') - - # Deleting field 'TestCenterUser.confirmed_at' - db.delete_column('student_testcenteruser', 'confirmed_at') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'db_index': 'False', 'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0024_add_allow_certificate.py b/common/djangoapps/student/migrations/0024_add_allow_certificate.py deleted file mode 100644 index 5753f0176e..0000000000 --- a/common/djangoapps/student/migrations/0024_add_allow_certificate.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'UserProfile.allow_certificate' - db.add_column('auth_userprofile', 'allow_certificate', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'UserProfile.allow_certificate' - db.delete_column('auth_userprofile', 'allow_certificate') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'db_index': 'False', 'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py b/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py deleted file mode 100644 index a60d121de8..0000000000 --- a/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py +++ /dev/null @@ -1,173 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseEnrollmentAllowed.auto_enroll' - db.add_column('student_courseenrollmentallowed', 'auto_enroll', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseEnrollmentAllowed.auto_enroll' - db.delete_column('student_courseenrollmentallowed', 'auto_enroll') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'db_index': 'False', 'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0026_auto__remove_index_student_testcenterregistration_accommodation_request.py b/common/djangoapps/student/migrations/0026_auto__remove_index_student_testcenterregistration_accommodation_request.py deleted file mode 100644 index 23fc476348..0000000000 --- a/common/djangoapps/student/migrations/0026_auto__remove_index_student_testcenterregistration_accommodation_request.py +++ /dev/null @@ -1,180 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models -from django.db.utils import DatabaseError - - -class Migration(SchemaMigration): - """ - Remove an unwanted index from environments that have it. - This is a one-way migration in that backwards is a no-op and will not undo the removal. - This migration is only relevant to dev environments that existed before a migration rewrite - which removed the creation of this index. - """ - - def forwards(self, orm): - try: - # Removing index on 'TestCenterRegistration', fields ['accommodation_request'] - db.delete_index('student_testcenterregistration', ['accommodation_request']) - except DatabaseError: - print "-- skipping delete_index of student_testcenterregistration.accommodation_request (index does not exist)" - - - def backwards(self, orm): - pass - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py b/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py deleted file mode 100644 index 112dccfe51..0000000000 --- a/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseEnrollment.is_active' - db.add_column('student_courseenrollment', 'is_active', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - # Adding field 'CourseEnrollment.mode' - db.add_column('student_courseenrollment', 'mode', - self.gf('django.db.models.fields.CharField')(default='honor', max_length=100), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseEnrollment.is_active' - db.delete_column('student_courseenrollment', 'is_active') - - # Deleting field 'CourseEnrollment.mode' - db.delete_column('student_courseenrollment', 'mode') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0028_auto__add_userstanding.py b/common/djangoapps/student/migrations/0028_auto__add_userstanding.py deleted file mode 100644 index ae66b86963..0000000000 --- a/common/djangoapps/student/migrations/0028_auto__add_userstanding.py +++ /dev/null @@ -1,188 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'UserStanding' - db.create_table('student_userstanding', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='standing', unique=True, to=orm['auth.User'])), - ('account_status', self.gf('django.db.models.fields.CharField')(max_length=31, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], blank=True)), - ('standing_last_changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('student', ['UserStanding']) - - - def backwards(self, orm): - # Deleting model 'UserStanding' - db.delete_table('student_userstanding') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py b/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py deleted file mode 100644 index 4975598157..0000000000 --- a/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py +++ /dev/null @@ -1,194 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'AnonymousUserId' - db.create_table('student_anonymoususerid', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('anonymous_user_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=16)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('student', ['AnonymousUserId']) - - - def backwards(self, orm): - # Deleting model 'AnonymousUserId' - db.delete_table('student_anonymoususerid') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '16'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.testcenterregistration': { - 'Meta': {'object_name': 'TestCenterRegistration'}, - 'accommodation_code': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'accommodation_request': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'authorization_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'client_authorization_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'eligibility_appointment_date_first': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'eligibility_appointment_date_last': ('django.db.models.fields.DateField', [], {'db_index': 'True'}), - 'exam_series_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'testcenter_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['student.TestCenterUser']"}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.testcenteruser': { - 'Meta': {'object_name': 'TestCenterUser'}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'address_3': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), - 'candidate_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'db_index': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'client_candidate_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}), - 'confirmed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'extension': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8', 'blank': 'True'}), - 'fax': ('django.db.models.fields.CharField', [], {'max_length': '35', 'blank': 'True'}), - 'fax_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'phone': ('django.db.models.fields.CharField', [], {'max_length': '35'}), - 'phone_country_code': ('django.db.models.fields.CharField', [], {'max_length': '3', 'db_index': 'True'}), - 'postal_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '16', 'blank': 'True'}), - 'processed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'upload_error_message': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'upload_status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '20', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'unique': 'True'}), - 'user_updated_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0029_remove_pearson.py b/common/djangoapps/student/migrations/0029_remove_pearson.py deleted file mode 100644 index 4e1cb09b4c..0000000000 --- a/common/djangoapps/student/migrations/0029_remove_pearson.py +++ /dev/null @@ -1,185 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'TestCenterUser' - db.delete_table('student_testcenteruser') - - # Deleting model 'TestCenterRegistration' - db.delete_table('student_testcenterregistration') - - - def backwards(self, orm): - # Adding model 'TestCenterUser' - db.create_table('student_testcenteruser', ( - ('last_name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('suffix', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('confirmed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True, db_index=True)), - ('salutation', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)), - ('postal_code', self.gf('django.db.models.fields.CharField')(blank=True, max_length=16, db_index=True)), - ('processed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('city', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('first_name', self.gf('django.db.models.fields.CharField')(max_length=30, db_index=True)), - ('middle_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)), - ('phone_country_code', self.gf('django.db.models.fields.CharField')(max_length=3, db_index=True)), - ('upload_status', self.gf('django.db.models.fields.CharField')(blank=True, max_length=20, db_index=True)), - ('state', self.gf('django.db.models.fields.CharField')(blank=True, max_length=20, db_index=True)), - ('upload_error_message', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)), - ('company_name', self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, db_index=True)), - ('candidate_id', self.gf('django.db.models.fields.IntegerField')(null=True, db_index=True)), - ('fax', self.gf('django.db.models.fields.CharField')(max_length=35, blank=True)), - ('user_updated_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('phone', self.gf('django.db.models.fields.CharField')(max_length=35)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['auth.User'], unique=True)), - ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(blank=True, null=True, db_index=True)), - ('extension', self.gf('django.db.models.fields.CharField')(blank=True, max_length=8, db_index=True)), - ('fax_country_code', self.gf('django.db.models.fields.CharField')(max_length=3, blank=True)), - ('country', self.gf('django.db.models.fields.CharField')(max_length=3, db_index=True)), - ('client_candidate_id', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True, db_index=True)), - ('address_1', self.gf('django.db.models.fields.CharField')(max_length=40)), - ('address_2', self.gf('django.db.models.fields.CharField')(max_length=40, blank=True)), - ('address_3', self.gf('django.db.models.fields.CharField')(max_length=40, blank=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True, db_index=True)), - )) - db.send_create_signal('student', ['TestCenterUser']) - - # Adding model 'TestCenterRegistration' - db.create_table('student_testcenterregistration', ( - ('client_authorization_id', self.gf('django.db.models.fields.CharField')(max_length=20, unique=True, db_index=True)), - ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('user_updated_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('authorization_id', self.gf('django.db.models.fields.IntegerField')(null=True, db_index=True)), - ('upload_status', self.gf('django.db.models.fields.CharField')(blank=True, max_length=20, db_index=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True, db_index=True)), - ('confirmed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True, db_index=True)), - ('accommodation_request', self.gf('django.db.models.fields.CharField')(max_length=1024, blank=True)), - ('eligibility_appointment_date_first', self.gf('django.db.models.fields.DateField')(db_index=True)), - ('exam_series_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), - ('processed_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('upload_error_message', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)), - ('accommodation_code', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), - ('testcenter_user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['student.TestCenterUser'])), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('eligibility_appointment_date_last', self.gf('django.db.models.fields.DateField')(db_index=True)), - )) - db.send_create_signal('student', ['TestCenterRegistration']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0030_auto__chg_field_anonymoususerid_anonymous_user_id.py b/common/djangoapps/student/migrations/0030_auto__chg_field_anonymoususerid_anonymous_user_id.py deleted file mode 100644 index f379ad6452..0000000000 --- a/common/djangoapps/student/migrations/0030_auto__chg_field_anonymoususerid_anonymous_user_id.py +++ /dev/null @@ -1,146 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'AnonymousUserId.anonymous_user_id' - db.alter_column('student_anonymoususerid', 'anonymous_user_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32)) - - # THIS SQL WAS HAND-CODED - db.execute(""" - CREATE TABLE student_anonymoususerid_temp_archive - AS SELECT * FROM student_anonymoususerid WHERE LENGTH(anonymous_user_id) = 16 - """) - db.execute(""" - DELETE FROM student_anonymoususerid - WHERE LENGTH(anonymous_user_id) = 16 - """) - - def backwards(self, orm): - - # Changing field 'AnonymousUserId.anonymous_user_id' - db.alter_column('student_anonymoususerid', 'anonymous_user_id', self.gf('django.db.models.fields.CharField')(max_length=16, unique=True)) - - db.execute("DROP TABLE student_anonymoususerid_temp_archive") - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0031_drop_student_anonymoususerid_temp_archive.py b/common/djangoapps/student/migrations/0031_drop_student_anonymoususerid_temp_archive.py deleted file mode 100644 index bbf31664b9..0000000000 --- a/common/djangoapps/student/migrations/0031_drop_student_anonymoususerid_temp_archive.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." - db.execute("DROP TABLE student_anonymoususerid_temp_archive") - - def backwards(self, orm): - "Write your backwards methods here." - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] - symmetrical = True diff --git a/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py b/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py deleted file mode 100644 index a4d323e498..0000000000 --- a/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py +++ /dev/null @@ -1,146 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'UserProfile.country' - db.add_column('auth_userprofile', 'country', - self.gf('django_countries.fields.CountryField')(max_length=2, null=True, blank=True), - keep_default=False) - - # Adding field 'UserProfile.city' - db.add_column('auth_userprofile', 'city', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'UserProfile.country' - db.delete_column('auth_userprofile', 'country') - - # Deleting field 'UserProfile.city' - db.delete_column('auth_userprofile', 'city') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0032_auto__add_loginfailures.py b/common/djangoapps/student/migrations/0032_auto__add_loginfailures.py deleted file mode 100644 index 70919c4198..0000000000 --- a/common/djangoapps/student/migrations/0032_auto__add_loginfailures.py +++ /dev/null @@ -1,149 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LoginFailures' - db.create_table('student_loginfailures', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('failure_count', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('lockout_until', self.gf('django.db.models.fields.DateTimeField')(null=True)), - )) - db.send_create_signal('student', ['LoginFailures']) - - - def backwards(self, orm): - # Deleting model 'LoginFailures' - db.delete_table('student_loginfailures') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py b/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py deleted file mode 100644 index c03a45f3f2..0000000000 --- a/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py +++ /dev/null @@ -1,156 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'PasswordHistory' - db.create_table('student_passwordhistory', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('password', self.gf('django.db.models.fields.CharField')(max_length=128)), - ('time_set', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), - )) - db.send_create_signal('student', ['PasswordHistory']) - - - def backwards(self, orm): - # Deleting model 'PasswordHistory' - db.delete_table('student_passwordhistory') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py b/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py deleted file mode 100644 index bf9ce5e9db..0000000000 --- a/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py +++ /dev/null @@ -1,189 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseAccessRole' - db.create_table('student_courseaccessrole', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('org', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=64, blank=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(db_index=True, max_length=255, blank=True)), - ('role', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - )) - db.send_create_signal('student', ['CourseAccessRole']) - - # Adding unique constraint on 'CourseAccessRole', fields ['user', 'org', 'course_id', 'role'] - db.create_unique('student_courseaccessrole', ['user_id', 'org', 'course_id', 'role']) - - - # Changing field 'AnonymousUserId.course_id' - db.alter_column('student_anonymoususerid', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - # Changing field 'CourseEnrollment.course_id' - db.alter_column('student_courseenrollment', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - # Changing field 'CourseEnrollmentAllowed.course_id' - db.alter_column('student_courseenrollmentallowed', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - def backwards(self, orm): - # Removing unique constraint on 'CourseAccessRole', fields ['user', 'org', 'course_id', 'role'] - db.delete_unique('student_courseaccessrole', ['user_id', 'org', 'course_id', 'role']) - - # Deleting model 'CourseAccessRole' - db.delete_table('student_courseaccessrole') - - - # Changing field 'AnonymousUserId.course_id' - db.alter_column('student_anonymoususerid', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Changing field 'CourseEnrollment.course_id' - db.alter_column('student_courseenrollment', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Changing field 'CourseEnrollmentAllowed.course_id' - db.alter_column('student_courseenrollmentallowed', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0035_access_roles.py b/common/djangoapps/student/migrations/0035_access_roles.py deleted file mode 100644 index bf7bec2dc6..0000000000 --- a/common/djangoapps/student/migrations/0035_access_roles.py +++ /dev/null @@ -1,312 +0,0 @@ -# -*- coding: utf-8 -*- -from south.v2 import DataMigration -import re -from opaque_keys.edx.locations import SlashSeparatedCourseKey -from opaque_keys import InvalidKeyError -import bson.son -import logging -from django.db.models.query_utils import Q -from django.db.utils import IntegrityError -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.mixed import MixedModuleStore -import itertools - -log = logging.getLogger(__name__) - - -class Migration(DataMigration): - """ - Converts course_creator, instructor_, staff_, and betatestuser_ to new table - """ - - # Because we instantiate the module store and the modulestore needs this config table to exist. - depends_on = ( - ("xblock_django", "0001_initial"), - ) - - GROUP_ENTRY_RE = re.compile(r'(?Pstaff|instructor|beta_testers|course_creator_group)_?(?P.*)') - - def forwards(self, orm): - """ - Converts group table entries for write access and beta_test roles to course access roles table. - """ - store = modulestore() - if isinstance(store, MixedModuleStore): - self.mongostore = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo) - self.xmlstore = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.xml) - elif store.get_modulestore_type() == ModuleStoreEnum.Type.mongo: - self.mongostore = store - self.xmlstore = None - elif store.get_modulestore_type() == ModuleStoreEnum.Type.xml: - self.mongostore = None - self.xmlstore = store - else: - return - - # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." - # b/c the Groups table had several entries for each course, we need to ensure we process each unique - # course only once. The below datastructures help ensure that. - hold = {} # key of course_id_strings with array of group objects. Should only be org scoped entries - # or deleted courses - orgs = {} # downcased org to last recorded normal case of the org - query = Q(name='course_creator_group') - for role in ['staff', 'instructor', 'beta_testers', ]: - query = query | Q(name__startswith=role) - for group in orm['auth.Group'].objects.filter(query).all(): - def _migrate_users(correct_course_key, role, lower_org): - """ - Get all the users from the old group and migrate to this course key in the new table - """ - for user in orm['auth.user'].objects.filter(groups=group).all(): - entry = orm['student.courseaccessrole']( - role=role, user=user, - org=correct_course_key.org, course_id=correct_course_key - ) - try: - entry.save() - except IntegrityError: - # already stored - pass - orgs[lower_org] = correct_course_key.org - - parsed_entry = self.GROUP_ENTRY_RE.match(group.name) - role = parsed_entry.group('role_id') - if role == 'course_creator_group': - for user in orm['auth.user'].objects.filter(groups=group).all(): - entry = orm['student.courseaccessrole'](role=role, user=user) - entry.save() - else: - course_id_string = parsed_entry.group('course_id_string') - try: - course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id_string) - # course_key is the downcased version, get the normal cased one. loc_mapper() has no - # methods taking downcased SSCK; so, need to do it manually here - correct_course_key = self._map_downcased_ssck(course_key) - if correct_course_key is not None: - _migrate_users(correct_course_key, role, course_key.org) - except InvalidKeyError: - # old dotted format, try permutations - parts = course_id_string.split('.') - if len(parts) < 3: - hold.setdefault(course_id_string, []).append(group) - elif len(parts) == 3: - course_key = SlashSeparatedCourseKey(*parts) - correct_course_key = self._map_downcased_ssck(course_key) - if correct_course_key is None: - hold.setdefault(course_id_string, []).append(group) - else: - _migrate_users(correct_course_key, role, course_key.org) - else: - correct_course_key = self.divide_parts_find_key(parts) - if correct_course_key is None: - hold.setdefault(course_id_string, []).append(group) - else: - _migrate_users(correct_course_key, role, correct_course_key.org) - - # see if any in hold were missed above - for held_auth_scope, groups in hold.iteritems(): - # orgs indexed by downcased org - held_auth_scope = held_auth_scope.lower() - if held_auth_scope in orgs: - for group in groups: - role = self.GROUP_ENTRY_RE.match(group.name).group('role_id') - # they have org permission - for user in orm['auth.user'].objects.filter(groups=group).all(): - entry = orm['student.courseaccessrole']( - role=role, - user=user, - org=orgs[held_auth_scope], - ) - entry.save() - else: - # don't silently skip unexpected roles - log.warn("Didn't convert roles %s", [group.name for group in groups]) - - def divide_parts_find_key(self, parts): - """ - Look for all possible org/course/run patterns from a possibly dotted source - """ - for org_stop, course_stop in itertools.combinations(range(1, len(parts)), 2): - org = '.'.join(parts[:org_stop]) - course = '.'.join(parts[org_stop:course_stop]) - run = '.'.join(parts[course_stop:]) - course_key = SlashSeparatedCourseKey(org, course, run) - correct_course_key = self._map_downcased_ssck(course_key) - if correct_course_key is not None: - return correct_course_key - return None - - def backwards(self, orm): - "Removes the new table." - # Since this migration is non-destructive (monotonically adds information), I'm not sure what - # the semantic of backwards should be other than perhaps clearing the table. - orm['student.courseaccessrole'].objects.all().delete() - - def _map_downcased_ssck(self, downcased_ssck): - """ - Get the normal cased version of this downcased slash sep course key - """ - if self.mongostore is not None: - course_son = bson.son.SON([ - ('_id.tag', 'i4x'), - ('_id.org', re.compile(ur'^{}$'.format(downcased_ssck.org), re.IGNORECASE | re.UNICODE)), - ('_id.course', re.compile(ur'^{}$'.format(downcased_ssck.course), re.IGNORECASE | re.UNICODE)), - ('_id.category', 'course'), - ('_id.name', re.compile(ur'^{}$'.format(downcased_ssck.run), re.IGNORECASE | re.UNICODE)), - ]) - entry = self.mongostore.collection.find_one(course_son) - if entry: - idpart = entry['_id'] - return SlashSeparatedCourseKey(idpart['org'], idpart['course'], idpart['name']) - if self.xmlstore is not None: - for course in self.xmlstore.get_courses(): - if ( - course.id.org.lower() == downcased_ssck.org and course.id.course.lower() == downcased_ssck.course - and course.id.run.lower() == downcased_ssck.run - ): - return course.id - return None - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - - complete_apps = ['student'] - symmetrical = True diff --git a/common/djangoapps/student/migrations/0036_access_roles_orgless.py b/common/djangoapps/student/migrations/0036_access_roles_orgless.py deleted file mode 100644 index f3af6b4613..0000000000 --- a/common/djangoapps/student/migrations/0036_access_roles_orgless.py +++ /dev/null @@ -1,278 +0,0 @@ -# -*- coding: utf-8 -*- -from south.v2 import DataMigration -from xmodule.modulestore.django import modulestore -import re -from opaque_keys.edx.locations import SlashSeparatedCourseKey -import logging -from django.db.models.query_utils import Q -from django.db.utils import IntegrityError -from xmodule.modulestore import ModuleStoreEnum -import bson.son -from xmodule.modulestore.mixed import MixedModuleStore -import itertools - -log = logging.getLogger(__name__) - - -class Migration(DataMigration): - """ - Converts course_creator, instructor_, staff_, and betatestuser_ to new table - """ - - GROUP_ENTRY_RE = re.compile(r'(?Pstaff|instructor|beta_testers)_(?P\S*)') - - def forwards(self, orm): - """ - Converts group table entries for write access and beta_test roles to course access roles table. - """ - store = modulestore() - if isinstance(store, MixedModuleStore): - self.mongostore = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo) - self.xmlstore = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.xml) - elif store.get_modulestore_type() == ModuleStoreEnum.Type.mongo: - self.mongostore = store - self.xmlstore = None - elif store.get_modulestore_type() == ModuleStoreEnum.Type.xml: - self.mongostore = None - self.xmlstore = store - else: - return - - query = Q(name__startswith='staff') | Q(name__startswith='instructor') | Q(name__startswith='beta_testers') - for group in orm['auth.Group'].objects.filter(query).exclude(name__contains="/").all(): - def _migrate_users(correct_course_key, role): - """ - Get all the users from the old group and migrate to this course key in the new table - """ - log.info( - u'Giving %s users access to %s', - group.name, correct_course_key - ) - for user in orm['auth.user'].objects.filter(groups=group).all(): - entry = orm['student.courseaccessrole']( - role=role, - user=user, - org=correct_course_key.org, - course_id=correct_course_key, - ) - try: - entry.save() - except IntegrityError: - pass - - parsed_entry = self.GROUP_ENTRY_RE.search(group.name) - if parsed_entry is None: - log.warn('Ignoring an unexpected unparsable entry %s', group.name) - continue - role = parsed_entry.group('role_id') - course_id_string = parsed_entry.group('course_id_string') - # if it's a full course_id w/ dots, ignore it - if u'/' not in course_id_string and not self.dotted_course(course_id_string): - # check new table to see if it's been added as org permission - if not orm['student.courseaccessrole'].objects.filter( - role=role, - org__iexact=course_id_string, - ).exists(): - # old auth was of form role_coursenum. Grant access to all such courses wildcarding org and run - # look in xml for matching courses - if self.xmlstore is not None: - for course in self.xmlstore.get_courses(): - if course_id_string == course.id.course.lower(): - _migrate_users(course.id, role) - - if self.mongostore is not None: - mongo_query = re.compile(ur'^{}$'.format(course_id_string), re.IGNORECASE) - for mongo_entry in self.mongostore.collection.find( - {"_id.category": "course", "_id.course": mongo_query}, fields=["_id"] - ): - mongo_id_dict = mongo_entry['_id'] - course_key = SlashSeparatedCourseKey( - mongo_id_dict['org'], mongo_id_dict['course'], mongo_id_dict['name'] - ) - _migrate_users(course_key, role) - - def dotted_course(self, parts): - """ - Look for all possible org/course/run patterns from a possibly dotted source - """ - for org_stop, course_stop in itertools.combinations(range(1, len(parts)), 2): - org = '.'.join(parts[:org_stop]) - course = '.'.join(parts[org_stop:course_stop]) - run = '.'.join(parts[course_stop:]) - course_key = SlashSeparatedCourseKey(org, course, run) - correct_course_key = self._map_downcased_ssck(course_key) - if correct_course_key is not None: - return correct_course_key - return False - - def _map_downcased_ssck(self, downcased_ssck): - """ - Get the normal cased version of this downcased slash sep course key - """ - if self.mongostore is not None: - course_son = bson.son.SON([ - ('_id.tag', 'i4x'), - ('_id.org', re.compile(ur'^{}$'.format(downcased_ssck.org), re.IGNORECASE | re.UNICODE)), - ('_id.course', re.compile(ur'^{}$'.format(downcased_ssck.course), re.IGNORECASE | re.UNICODE)), - ('_id.category', 'course'), - ('_id.name', re.compile(ur'^{}$'.format(downcased_ssck.run), re.IGNORECASE | re.UNICODE)), - ]) - entry = self.mongostore.collection.find_one(course_son) - if entry: - idpart = entry['_id'] - return SlashSeparatedCourseKey(idpart['org'], idpart['course'], idpart['name']) - if self.xmlstore is not None: - for course in self.xmlstore.get_courses(): - if ( - course.id.org.lower() == downcased_ssck.org and course.id.course.lower() == downcased_ssck.course - and course.id.run.lower() == downcased_ssck.run - ): - return course.id - return None - - def backwards(self, orm): - "No obvious way to reverse just this migration, but reversing 0035 will reverse this." - pass - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - - complete_apps = ['student'] - symmetrical = True diff --git a/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py b/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py deleted file mode 100644 index c60425df8a..0000000000 --- a/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py +++ /dev/null @@ -1,179 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseRegistrationCode' - db.create_table('student_courseregistrationcode', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('transaction_group_name', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, null=True, blank=True)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='created_by_user', to=orm['auth.User'])), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 24, 0, 0))), - ('redeemed_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='redeemed_by_user', null=True, to=orm['auth.User'])), - ('redeemed_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 24, 0, 0), null=True)), - )) - db.send_create_signal('student', ['CourseRegistrationCode']) - - - def backwards(self, orm): - # Deleting model 'CourseRegistrationCode' - db.delete_table('student_courseregistrationcode') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 6, 24, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 6, 24, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'redeemed_by_user'", 'null': 'True', 'to': "orm['auth.User']"}), - 'transaction_group_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py b/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py deleted file mode 100644 index faa725b794..0000000000 --- a/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py +++ /dev/null @@ -1,180 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'UserSignupSource' - db.create_table('student_usersignupsource', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('site', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('student', ['UserSignupSource']) - - - def backwards(self, orm): - # Deleting model 'UserSignupSource' - db.delete_table('student_usersignupsource') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 6, 25, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 6, 25, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'redeemed_by_user'", 'null': 'True', 'to': "orm['auth.User']"}), - 'transaction_group_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user_id': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py b/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py deleted file mode 100644 index 441b52ea2c..0000000000 --- a/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py +++ /dev/null @@ -1,174 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'CourseRegistrationCode' - db.delete_table('student_courseregistrationcode') - - - def backwards(self, orm): - # Adding model 'CourseRegistrationCode' - db.create_table('student_courseregistrationcode', ( - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('transaction_group_name', self.gf('django.db.models.fields.CharField')(blank=True, max_length=255, null=True, db_index=True)), - ('redeemed_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='redeemed_by_user', null=True, to=orm['auth.User'])), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('redeemed_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 25, 0, 0), null=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 25, 0, 0))), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='created_by_user', to=orm['auth.User'])), - )) - db.send_create_signal('student', ['CourseRegistrationCode']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user_id': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py b/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py deleted file mode 100644 index cabacf8de7..0000000000 --- a/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'UserSignupSource.user_id' - db.delete_column('student_usersignupsource', 'user_id_id') - - # Adding field 'UserSignupSource.user' - db.add_column('student_usersignupsource', 'user', - self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['auth.User']), - keep_default=False) - - - def backwards(self, orm): - - # User chose to not deal with backwards NULL issues for 'UserSignupSource.user_id' - raise RuntimeError("Cannot reverse this migration. 'UserSignupSource.user_id' and its values cannot be restored.") - # Deleting field 'UserSignupSource.user' - db.delete_column('student_usersignupsource', 'user_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0041_add_dashboard_config.py b/common/djangoapps/student/migrations/0041_add_dashboard_config.py deleted file mode 100644 index dbf6da578c..0000000000 --- a/common/djangoapps/student/migrations/0041_add_dashboard_config.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'DashboardConfiguration' - db.create_table('student_dashboardconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('recent_enrollment_time_delta', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), - )) - db.send_create_signal('student', ['DashboardConfiguration']) - - def backwards(self, orm): - # Deleting model 'DashboardConfiguration' - db.delete_table('student_dashboardconfiguration') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0042_grant_sales_admin_roles.py b/common/djangoapps/student/migrations/0042_grant_sales_admin_roles.py deleted file mode 100644 index ccbb58f7fc..0000000000 --- a/common/djangoapps/student/migrations/0042_grant_sales_admin_roles.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models, IntegrityError - - -class Migration(DataMigration): - - def forwards(self, orm): - """Map all Finance Admins to Sales Admins.""" - finance_admins = orm['student.courseaccessrole'].objects.filter(role='finance_admin') - - for finance_admin in finance_admins: - sales_admin = orm['student.courseaccessrole']( - role='sales_admin', - user=finance_admin.user, - org=finance_admin.org, - course_id=finance_admin.course_id, - ) - try: - sales_admin.save() - except IntegrityError: - pass # If sales admin roles exist, continue. - - def backwards(self, orm): - """Remove all sales administrators, as they did not exist before this migration. """ - sales_admins = orm['student.courseaccessrole'].objects.filter(role='sales_admin') - sales_admins.delete() - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] - symmetrical = True diff --git a/common/djangoapps/student/migrations/0043_auto__add_linkedinaddtoprofileconfiguration.py b/common/djangoapps/student/migrations/0043_auto__add_linkedinaddtoprofileconfiguration.py deleted file mode 100644 index 41ec46effd..0000000000 --- a/common/djangoapps/student/migrations/0043_auto__add_linkedinaddtoprofileconfiguration.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LinkedInAddToProfileConfiguration' - db.create_table('student_linkedinaddtoprofileconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('dashboard_tracking_code', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('student', ['LinkedInAddToProfileConfiguration']) - - - def backwards(self, orm): - # Deleting model 'LinkedInAddToProfileConfiguration' - db.delete_table('student_linkedinaddtoprofileconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0044_linkedin_add_company_identifier.py b/common/djangoapps/student/migrations/0044_linkedin_add_company_identifier.py deleted file mode 100644 index 0f6b749591..0000000000 --- a/common/djangoapps/student/migrations/0044_linkedin_add_company_identifier.py +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'LinkedInAddToProfileConfiguration.company_identifier' - db.add_column('student_linkedinaddtoprofileconfiguration', 'company_identifier', - self.gf('django.db.models.fields.TextField')(default=''), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'LinkedInAddToProfileConfiguration.company_identifier' - db.delete_column('student_linkedinaddtoprofileconfiguration', 'company_identifier') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0045_add_trk_partner_to_linkedin_config.py b/common/djangoapps/student/migrations/0045_add_trk_partner_to_linkedin_config.py deleted file mode 100644 index 87128512d4..0000000000 --- a/common/djangoapps/student/migrations/0045_add_trk_partner_to_linkedin_config.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'LinkedInAddToProfileConfiguration.trk_partner_name' - db.add_column('student_linkedinaddtoprofileconfiguration', 'trk_partner_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=10, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'LinkedInAddToProfileConfiguration.trk_partner_name' - db.delete_column('student_linkedinaddtoprofileconfiguration', 'trk_partner_name') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0046_auto__add_entranceexamconfiguration__add_unique_entranceexamconfigurat.py b/common/djangoapps/student/migrations/0046_auto__add_entranceexamconfiguration__add_unique_entranceexamconfigurat.py deleted file mode 100644 index a0373d043e..0000000000 --- a/common/djangoapps/student/migrations/0046_auto__add_entranceexamconfiguration__add_unique_entranceexamconfigurat.py +++ /dev/null @@ -1,205 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'EntranceExamConfiguration' - db.create_table('student_entranceexamconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, db_index=True, blank=True)), - ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - ('skip_entrance_exam', self.gf('django.db.models.fields.BooleanField')(default=True)), - )) - db.send_create_signal('student', ['EntranceExamConfiguration']) - - # Adding unique constraint on 'EntranceExamConfiguration', fields ['user', 'course_id'] - db.create_unique('student_entranceexamconfiguration', ['user_id', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'EntranceExamConfiguration', fields ['user', 'course_id'] - db.delete_unique('student_entranceexamconfiguration', ['user_id', 'course_id']) - - # Deleting model 'EntranceExamConfiguration' - db.delete_table('student_entranceexamconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0047_add_bio_field.py b/common/djangoapps/student/migrations/0047_add_bio_field.py deleted file mode 100644 index 33f42d2e65..0000000000 --- a/common/djangoapps/student/migrations/0047_add_bio_field.py +++ /dev/null @@ -1,194 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'UserProfile.bio' - db.add_column('auth_userprofile', 'bio', - self.gf('django.db.models.fields.CharField')(max_length=3000, null=True, blank=True, db_index=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'UserProfile.bio' - db.delete_column('auth_userprofile', 'bio') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'db_index': 'False', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0048_add_profile_image_version.py b/common/djangoapps/student/migrations/0048_add_profile_image_version.py deleted file mode 100644 index 80e14e2f72..0000000000 --- a/common/djangoapps/student/migrations/0048_add_profile_image_version.py +++ /dev/null @@ -1,195 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'UserProfile.profile_image_uploaded_at' - db.add_column('auth_userprofile', 'profile_image_uploaded_at', - self.gf('django.db.models.fields.DateTimeField')(null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'UserProfile.profile_image_uploaded_at' - db.delete_column('auth_userprofile', 'profile_image_uploaded_at') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'db_index': 'False', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'has_profile_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0049_auto__add_languageproficiency__add_unique_languageproficiency_code_use.py b/common/djangoapps/student/migrations/0049_auto__add_languageproficiency__add_unique_languageproficiency_code_use.py deleted file mode 100644 index 252e3f03c4..0000000000 --- a/common/djangoapps/student/migrations/0049_auto__add_languageproficiency__add_unique_languageproficiency_code_use.py +++ /dev/null @@ -1,210 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LanguageProficiency' - db.create_table('student_languageproficiency', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user_profile', self.gf('django.db.models.fields.related.ForeignKey')(related_name='language_proficiencies', to=orm['student.UserProfile'])), - ('code', self.gf('django.db.models.fields.CharField')(max_length=16)), - )) - db.send_create_signal('student', ['LanguageProficiency']) - - # Adding unique constraint on 'LanguageProficiency', fields ['code', 'user_profile'] - db.create_unique('student_languageproficiency', ['code', 'user_profile_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'LanguageProficiency', fields ['code', 'user_profile'] - db.delete_unique('student_languageproficiency', ['code', 'user_profile_id']) - - # Deleting model 'LanguageProficiency' - db.delete_table('student_languageproficiency') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.languageproficiency': { - 'Meta': {'unique_together': "(('code', 'user_profile'),)", 'object_name': 'LanguageProficiency'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'language_proficiencies'", 'to': "orm['student.UserProfile']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'db_index': 'False', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'profile_image_uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0050_auto__add_manualenrollmentaudit.py b/common/djangoapps/student/migrations/0050_auto__add_manualenrollmentaudit.py deleted file mode 100644 index 90c3025d5e..0000000000 --- a/common/djangoapps/student/migrations/0050_auto__add_manualenrollmentaudit.py +++ /dev/null @@ -1,216 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'ManualEnrollmentAudit' - db.create_table('student_manualenrollmentaudit', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('enrollment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['student.CourseEnrollment'], null=True)), - ('enrolled_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), - ('enrolled_email', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('time_stamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)), - ('state_transition', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('reason', self.gf('django.db.models.fields.TextField')(null=True)), - )) - db.send_create_signal('student', ['ManualEnrollmentAudit']) - - def backwards(self, orm): - # Deleting model 'ManualEnrollmentAudit' - db.delete_table('student_manualenrollmentaudit') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.languageproficiency': { - 'Meta': {'unique_together': "(('code', 'user_profile'),)", 'object_name': 'LanguageProficiency'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'language_proficiencies'", 'to': "orm['student.UserProfile']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.manualenrollmentaudit': { - 'Meta': {'object_name': 'ManualEnrollmentAudit'}, - 'enrolled_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'enrolled_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'state_transition': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'profile_image_uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0051_auto__add_courseenrollmentattribute.py b/common/djangoapps/student/migrations/0051_auto__add_courseenrollmentattribute.py deleted file mode 100644 index 66c218382c..0000000000 --- a/common/djangoapps/student/migrations/0051_auto__add_courseenrollmentattribute.py +++ /dev/null @@ -1,224 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseEnrollmentAttribute' - db.create_table('student_courseenrollmentattribute', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('enrollment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['student.CourseEnrollment'])), - ('namespace', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('value', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal('student', ['CourseEnrollmentAttribute']) - - - def backwards(self, orm): - # Deleting model 'CourseEnrollmentAttribute' - db.delete_table('student_courseenrollmentattribute') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollmentattribute': { - 'Meta': {'object_name': 'CourseEnrollmentAttribute'}, - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.languageproficiency': { - 'Meta': {'unique_together': "(('code', 'user_profile'),)", 'object_name': 'LanguageProficiency'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'language_proficiencies'", 'to': "orm['student.UserProfile']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.manualenrollmentaudit': { - 'Meta': {'object_name': 'ManualEnrollmentAudit'}, - 'enrolled_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'enrolled_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'state_transition': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'profile_image_uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0052_auto__add_historicalcourseenrollment.py b/common/djangoapps/student/migrations/0052_auto__add_historicalcourseenrollment.py deleted file mode 100644 index 123050c5f4..0000000000 --- a/common/djangoapps/student/migrations/0052_auto__add_historicalcourseenrollment.py +++ /dev/null @@ -1,242 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'HistoricalCourseEnrollment' - db.create_table('student_historicalcourseenrollment', ( - ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(db_index=True, null=True, blank=True)), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('mode', self.gf('django.db.models.fields.CharField')(default='honor', max_length=100)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name=u'+', null=True, on_delete=models.DO_NOTHING, to=orm['auth.User'])), - (u'history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - (u'history_date', self.gf('django.db.models.fields.DateTimeField')()), - (u'history_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name=u'+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - (u'history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), - )) - db.send_create_signal('student', ['HistoricalCourseEnrollment']) - - - def backwards(self, orm): - # Deleting model 'HistoricalCourseEnrollment' - db.delete_table('student_historicalcourseenrollment') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollmentattribute': { - 'Meta': {'object_name': 'CourseEnrollmentAttribute'}, - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['student.CourseEnrollment']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.historicalcourseenrollment': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['auth.User']"}) - }, - 'student.languageproficiency': { - 'Meta': {'unique_together': "(('code', 'user_profile'),)", 'object_name': 'LanguageProficiency'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'language_proficiencies'", 'to': "orm['student.UserProfile']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.manualenrollmentaudit': { - 'Meta': {'object_name': 'ManualEnrollmentAudit'}, - 'enrolled_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'enrolled_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'state_transition': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'profile_image_uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0053_auto__add_enrollmentrefundconfiguration.py b/common/djangoapps/student/migrations/0053_auto__add_enrollmentrefundconfiguration.py deleted file mode 100644 index 6311bca541..0000000000 --- a/common/djangoapps/student/migrations/0053_auto__add_enrollmentrefundconfiguration.py +++ /dev/null @@ -1,245 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'EnrollmentRefundConfiguration' - db.create_table('student_enrollmentrefundconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('refund_window_microseconds', self.gf('django.db.models.fields.BigIntegerField')(default=1209600000000)), - )) - db.send_create_signal('student', ['EnrollmentRefundConfiguration']) - - - def backwards(self, orm): - # Deleting model 'EnrollmentRefundConfiguration' - db.delete_table('student_enrollmentrefundconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'student.anonymoususerid': { - 'Meta': {'object_name': 'AnonymousUserId'}, - 'anonymous_user_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseaccessrole': { - 'Meta': {'unique_together': "(('user', 'org', 'course_id', 'role'),)", 'object_name': 'CourseAccessRole'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), - 'role': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.courseenrollmentallowed': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'CourseEnrollmentAllowed'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollmentattribute': { - 'Meta': {'object_name': 'CourseEnrollmentAttribute'}, - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['student.CourseEnrollment']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'student.dashboardconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'DashboardConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'recent_enrollment_time_delta': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'student.enrollmentrefundconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'EnrollmentRefundConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'refund_window_microseconds': ('django.db.models.fields.BigIntegerField', [], {'default': '1209600000000'}) - }, - 'student.entranceexamconfiguration': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'EntranceExamConfiguration'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'skip_entrance_exam': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.historicalcourseenrollment': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['auth.User']"}) - }, - 'student.languageproficiency': { - 'Meta': {'unique_together': "(('code', 'user_profile'),)", 'object_name': 'LanguageProficiency'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'language_proficiencies'", 'to': "orm['student.UserProfile']"}) - }, - 'student.linkedinaddtoprofileconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'LinkedInAddToProfileConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'company_identifier': ('django.db.models.fields.TextField', [], {}), - 'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'trk_partner_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}) - }, - 'student.loginfailures': { - 'Meta': {'object_name': 'LoginFailures'}, - 'failure_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lockout_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.manualenrollmentaudit': { - 'Meta': {'object_name': 'ManualEnrollmentAudit'}, - 'enrolled_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'enrolled_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'state_transition': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'time_stamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.passwordhistory': { - 'Meta': {'object_name': 'PasswordHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'time_set': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.pendingemailchange': { - 'Meta': {'object_name': 'PendingEmailChange'}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.pendingnamechange': { - 'Meta': {'object_name': 'PendingNameChange'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.registration': { - 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, - 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) - }, - 'student.userprofile': { - 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, - 'allow_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'bio': ('django.db.models.fields.CharField', [], {'max_length': '3000', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), - 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), - 'gender': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'goals': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'level_of_education': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '6', 'null': 'True', 'blank': 'True'}), - 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'profile_image_uploaded_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}), - 'year_of_birth': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) - }, - 'student.usersignupsource': { - 'Meta': {'object_name': 'UserSignupSource'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'site': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'student.userstanding': { - 'Meta': {'object_name': 'UserStanding'}, - 'account_status': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'standing_last_changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'standing'", 'unique': 'True', 'to': "orm['auth.User']"}) - }, - 'student.usertestgroup': { - 'Meta': {'object_name': 'UserTestGroup'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) - } - } - - complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 2faf03bba4..5e0d13d6d8 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -42,7 +42,6 @@ from eventtracking import tracker from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey from simple_history.models import HistoricalRecords -from south.modelsinspector import add_introspection_rules from track import contexts from xmodule_django.models import CourseKeyField, NoneToEmptyManager @@ -189,7 +188,7 @@ class UserStanding(models.Model): (ACCOUNT_ENABLED, u"Account Enabled"), ) - user = models.ForeignKey(User, db_index=True, related_name='standing', unique=True) + user = models.OneToOneField(User, db_index=True, related_name='standing') account_status = models.CharField( blank=True, max_length=31, choices=USER_STANDING_CHOICES ) @@ -493,7 +492,7 @@ class Registration(models.Model): class Meta(object): db_table = "auth_registration" - user = models.ForeignKey(User, unique=True) + user = models.OneToOneField(User) activation_key = models.CharField(('activation key'), max_length=32, unique=True, db_index=True) def register(self, user): @@ -824,7 +823,7 @@ class CourseEnrollmentManager(models.Manager): 'course_id' is the course_id to return enrollments """ - enrollment_number = super(CourseEnrollmentManager, self).get_query_set().filter( + enrollment_number = super(CourseEnrollmentManager, self).get_queryset().filter( course_id=course_id, is_active=1 ).count() @@ -855,7 +854,7 @@ class CourseEnrollmentManager(models.Manager): """ # Unfortunately, Django's "group by"-style queries look super-awkward query = use_read_replica_if_available( - super(CourseEnrollmentManager, self).get_query_set().filter(course_id=course_id, is_active=True).values( + super(CourseEnrollmentManager, self).get_queryset().filter(course_id=course_id, is_active=True).values( 'mode').order_by().annotate(Count('mode'))) total = 0 enroll_dict = defaultdict(int) @@ -923,6 +922,7 @@ class CourseEnrollment(models.Model): ).format(self.user, self.course_id, self.created, self.is_active) @classmethod + @transaction.atomic def get_or_create_enrollment(cls, user, course_key): """ Create an enrollment for a user in a class. By default *this enrollment @@ -950,32 +950,16 @@ class CourseEnrollment(models.Model): if user.id is None: user.save() - try: - enrollment, created = CourseEnrollment.objects.get_or_create( - user=user, - course_id=course_key, - ) + enrollment, created = CourseEnrollment.objects.get_or_create( + user=user, + course_id=course_key, + ) - # If we *did* just create a new enrollment, set some defaults - if created: - enrollment.mode = "honor" - enrollment.is_active = False - enrollment.save() - except IntegrityError: - log.info( - ( - "An integrity error occurred while getting-or-creating the enrollment" - "for course key %s and student %s. This can occur if two processes try to get-or-create " - "the enrollment at the same time and the database is set to REPEATABLE READ. We will try " - "committing the transaction and retrying." - ), - course_key, user - ) - transaction.commit() - enrollment = CourseEnrollment.objects.get( - user=user, - course_id=course_key, - ) + # If we *did* just create a new enrollment, set some defaults + if created: + enrollment.mode = "honor" + enrollment.is_active = False + enrollment.save() return enrollment @@ -1950,9 +1934,6 @@ class LanguageField(models.CharField): ) -add_introspection_rules([], [r"^student\.models\.LanguageField"]) - - class LanguageProficiency(models.Model): """ Represents a user's language proficiency. diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index d7aaf01180..1b56924dcf 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -12,6 +12,7 @@ from student.models import UserProfile, PendingEmailChange from django.core.urlresolvers import reverse from django.core import mail from django.contrib.auth.models import User +from django.db import transaction from django.test import TestCase, TransactionTestCase from django.test.client import RequestFactory from mock import Mock, patch @@ -35,7 +36,6 @@ def mock_render_to_string(template_name, context): def mock_render_to_response(template_name, context): """Return an HttpResponse with content that encodes template_name and context""" - # View confirm_email_change uses @transaction.commit_manually. # This simulates any db access in the templates. UserProfile.objects.exists() return HttpResponse(mock_render_to_string(template_name, context)) @@ -418,9 +418,10 @@ class EmailChangeConfirmationTests(EmailTestMixin, TransactionTestCase): self.assertEquals(0, PendingEmailChange.objects.count()) @patch('student.views.PendingEmailChange.objects.get', Mock(side_effect=TestException)) - @patch('student.views.transaction.rollback', wraps=django.db.transaction.rollback) - def test_always_rollback(self, rollback, _email_user): - with self.assertRaises(TestException): - confirm_email_change(self.request, self.key) + def test_always_rollback(self, _email_user): + connection = transaction.get_connection() + with patch.object(connection, 'rollback', wraps=connection.rollback) as mock_rollback: + with self.assertRaises(TestException): + confirm_email_change(self.request, self.key) - rollback.assert_called_with() + mock_rollback.assert_called_with() diff --git a/common/djangoapps/student/tests/test_login.py b/common/djangoapps/student/tests/test_login.py index 9ac21c17f5..d293af908a 100644 --- a/common/djangoapps/student/tests/test_login.py +++ b/common/djangoapps/student/tests/test_login.py @@ -284,6 +284,9 @@ class LoginTest(TestCase): response = client1.post(self.url, creds) self._assert_response(response, success=True) + # Reload the user from the database + self.user = User.objects.get(pk=self.user.pk) # pylint: disable=no-member + self.assertEqual(self.user.profile.get_meta()['session_id'], client1.session.session_key) # second login should log out the first @@ -501,7 +504,7 @@ class LoginOAuthTokenMixin(ThirdPartyOAuthTestMixin): self._setup_provider_response(success=True) response = self.client.post(self.url, {"access_token": "dummy"}) self.assertEqual(response.status_code, 204) - self.assertEqual(self.client.session['_auth_user_id'], self.user.id) # pylint: disable=no-member + self.assertEqual(int(self.client.session['_auth_user_id']), self.user.id) # pylint: disable=no-member def test_invalid_token(self): self._setup_provider_response(success=False) diff --git a/common/djangoapps/student/tests/test_password_policy.py b/common/djangoapps/student/tests/test_password_policy.py index 194de075f3..c606478b25 100644 --- a/common/djangoapps/student/tests/test_password_policy.py +++ b/common/djangoapps/student/tests/test_password_policy.py @@ -7,7 +7,7 @@ from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser -from django.utils.importlib import import_module +from importlib import import_module from django.test.utils import override_settings from django.conf import settings from mock import patch diff --git a/common/djangoapps/student/tests/test_reset_password.py b/common/djangoapps/student/tests/test_reset_password.py index 511395fbe3..ac07a0c4e0 100644 --- a/common/djangoapps/student/tests/test_reset_password.py +++ b/common/djangoapps/student/tests/test_reset_password.py @@ -10,10 +10,11 @@ from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import User -from django.contrib.auth.hashers import UNUSABLE_PASSWORD +from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX from django.contrib.auth.tokens import default_token_generator -from django.utils.http import int_to_base36 +from django.utils.encoding import force_bytes, force_text +from django.utils.http import urlsafe_base64_encode, base36_to_int, int_to_base36 from mock import Mock, patch import ddt @@ -42,12 +43,16 @@ class ResetPasswordTests(EventTestMixin, TestCase): self.user_bad_passwd = UserFactory.create() self.user_bad_passwd.is_active = False - self.user_bad_passwd.password = UNUSABLE_PASSWORD + self.user_bad_passwd.password = UNUSABLE_PASSWORD_PREFIX self.user_bad_passwd.save() + def uidb36_to_uidb64(self, uidb36=None): + """ Converts uidb36 into uidb64 """ + return force_text(urlsafe_base64_encode(force_bytes(base36_to_int(uidb36 or self.uidb36)))) + @patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True)) def test_user_bad_password_reset(self): - """Tests password reset behavior for user with password marked UNUSABLE_PASSWORD""" + """Tests password reset behavior for user with password marked UNUSABLE_PASSWORD_PREFIX""" bad_pwd_req = self.request_factory.post('/password_reset/', {'email': self.user_bad_passwd.email}) bad_pwd_resp = password_reset(bad_pwd_req) @@ -217,7 +222,9 @@ class ResetPasswordTests(EventTestMixin, TestCase): bad_reset_req = self.request_factory.get('/password_reset_confirm/NO-OP/') password_reset_confirm_wrapper(bad_reset_req, 'NO', 'OP') confirm_kwargs = reset_confirm.call_args[1] - self.assertEquals(confirm_kwargs['uidb36'], 'NO') + + self.assertEquals(confirm_kwargs['uidb64'], self.uidb36_to_uidb64('NO')) + self.assertEquals(confirm_kwargs['token'], 'OP') self.user = User.objects.get(pk=self.user.pk) self.assertFalse(self.user.is_active) @@ -229,7 +236,7 @@ class ResetPasswordTests(EventTestMixin, TestCase): good_reset_req = self.request_factory.get('/password_reset_confirm/{0}-{1}/'.format(self.uidb36, self.token)) password_reset_confirm_wrapper(good_reset_req, self.uidb36, self.token) confirm_kwargs = reset_confirm.call_args[1] - self.assertEquals(confirm_kwargs['uidb36'], self.uidb36) + self.assertEquals(confirm_kwargs['uidb64'], self.uidb36_to_uidb64()) self.assertEquals(confirm_kwargs['token'], self.token) self.user = User.objects.get(pk=self.user.pk) self.assertTrue(self.user.is_active) @@ -251,7 +258,7 @@ class ResetPasswordTests(EventTestMixin, TestCase): good_reset_req = self.request_factory.get('/password_reset_confirm/{0}-{1}/'.format(self.uidb36, self.token)) password_reset_confirm_wrapper(good_reset_req, self.uidb36, self.token) confirm_kwargs = reset_confirm.call_args[1] - self.assertEquals(confirm_kwargs['uidb36'], self.uidb36) + self.assertEquals(confirm_kwargs['uidb64'], self.uidb36_to_uidb64()) self.assertEquals(confirm_kwargs['token'], self.token) self.user = User.objects.get(pk=self.user.pk) self.assertTrue(self.user.is_active) diff --git a/common/djangoapps/student/tests/test_verification_status.py b/common/djangoapps/student/tests/test_verification_status.py index 140b2f71d4..c3002bb63d 100644 --- a/common/djangoapps/student/tests/test_verification_status.py +++ b/common/djangoapps/student/tests/test_verification_status.py @@ -20,7 +20,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from student.tests.factories import UserFactory, CourseEnrollmentFactory from course_modes.tests.factories import CourseModeFactory -from verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification # pylint: disable=import-error +from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification from util.testing import UrlResetMixin diff --git a/common/djangoapps/student/tests/tests.py b/common/djangoapps/student/tests/tests.py index a2c1e05ae4..42f19757f2 100644 --- a/common/djangoapps/student/tests/tests.py +++ b/common/djangoapps/student/tests/tests.py @@ -39,7 +39,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, ModuleSt from bulk_email.models import Optout # pylint: disable=import-error from certificates.models import CertificateStatuses # pylint: disable=import-error from certificates.tests.factories import GeneratedCertificateFactory # pylint: disable=import-error -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification import shoppingcart # pylint: disable=import-error from openedx.core.djangoapps.programs.tests.mixins import ProgramsApiConfigMixin diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 8d5aecb42e..dcf9aacab6 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -27,8 +27,9 @@ from django.db import IntegrityError, transaction from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseServerError, Http404) from django.shortcuts import redirect +from django.utils.encoding import force_bytes, force_text from django.utils.translation import ungettext -from django.utils.http import base36_to_int +from django.utils.http import base36_to_int, urlsafe_base64_encode from django.utils.translation import ugettext as _, get_language from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie from django.views.decorators.http import require_POST, require_GET @@ -55,7 +56,7 @@ from student.models import ( DashboardConfiguration, LinkedInAddToProfileConfiguration, ManualEnrollmentAudit, ALLOWEDTOENROLL_TO_ENROLLED) from student.forms import AccountCreationForm, PasswordResetFormNoActive -from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=import-error +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from certificates.models import CertificateStatuses, certificate_status_for_student from certificates.api import ( # pylint: disable=import-error get_certificate_url, @@ -90,7 +91,7 @@ import track.views import dogstats_wrapper as dog_stats_api -from util.db import commit_on_success_with_read_committed +from util.db import outer_atomic from util.json_request import JsonResponse from util.bad_request_rate_limiter import BadRequestRateLimiter from util.milestones_helpers import ( @@ -923,8 +924,9 @@ def _credit_statuses(user, course_enrollments): return statuses +@transaction.non_atomic_requests @require_POST -@commit_on_success_with_read_committed +@outer_atomic(read_committed=True) def change_enrollment(request, check_access=True): """ Modify the enrollment status for the logged-in user. @@ -1441,7 +1443,8 @@ def _do_create_account(form): # TODO: Rearrange so that if part of the process fails, the whole process fails. # Right now, we can have e.g. no registration e-mail sent out and a zombie account try: - user.save() + with transaction.atomic(): + user.save() except IntegrityError: # Figure out the cause of the integrity error if len(User.objects.filter(username=user.username)) > 0: @@ -1573,7 +1576,7 @@ def create_account_with_params(request, params): ) # Perform operations within a transaction that are critical to account creation - with transaction.commit_on_success(): + with transaction.atomic(): # first, create the account (user, profile, registration) = _do_create_account(form) @@ -2055,12 +2058,19 @@ def password_reset_confirm_wrapper( # we also want to pass settings.PLATFORM_NAME in as extra_context extra_context = {"platform_name": microsite.get_value('platform_name', settings.PLATFORM_NAME)} + # Support old password reset URLs that used base36 encoded user IDs. + # https://github.com/django/django/commit/1184d077893ff1bc947e45b00a4d565f3df81776#diff-c571286052438b2e3190f8db8331a92bR231 + try: + uidb64 = force_text(urlsafe_base64_encode(force_bytes(base36_to_int(uidb36)))) + except ValueError: + uidb64 = '1' # dummy invalid ID (incorrect padding for base64) + if request.method == 'POST': # remember what the old password hash is before we call down old_password_hash = user.password result = password_reset_confirm( - request, uidb36=uidb36, token=token, extra_context=extra_context + request, uidb64=uidb64, token=token, extra_context=extra_context ) # get the updated user @@ -2074,7 +2084,7 @@ def password_reset_confirm_wrapper( return result else: return password_reset_confirm( - request, uidb36=uidb36, token=token, extra_context=extra_context + request, uidb64=uidb64, token=token, extra_context=extra_context ) @@ -2182,18 +2192,17 @@ def do_email_change_request(user, new_email, activation_key=None): @ensure_csrf_cookie -@transaction.commit_manually def confirm_email_change(request, key): # pylint: disable=unused-argument """ User requested a new e-mail. This is called when the activation link is clicked. We confirm with the old e-mail, and update """ - try: + with transaction.atomic(): try: pec = PendingEmailChange.objects.get(activation_key=key) except PendingEmailChange.DoesNotExist: response = render_to_response("invalid_email_key.html", {}) - transaction.rollback() + transaction.set_rollback(True) return response user = pec.user @@ -2204,7 +2213,7 @@ def confirm_email_change(request, key): # pylint: disable=unused-argument if len(User.objects.filter(email=pec.new_email)) != 0: response = render_to_response("email_exists.html", {}) - transaction.rollback() + transaction.set_rollback(True) return response subject = render_to_string('emails/email_change_subject.txt', address_context) @@ -2223,7 +2232,7 @@ def confirm_email_change(request, key): # pylint: disable=unused-argument except Exception: # pylint: disable=broad-except log.warning('Unable to send confirmation email to old address', exc_info=True) response = render_to_response("email_change_failed.html", {'email': user.email}) - transaction.rollback() + transaction.set_rollback(True) return response user.email = pec.new_email @@ -2235,16 +2244,11 @@ def confirm_email_change(request, key): # pylint: disable=unused-argument except Exception: # pylint: disable=broad-except log.warning('Unable to send confirmation email to new address', exc_info=True) response = render_to_response("email_change_failed.html", {'email': pec.new_email}) - transaction.rollback() + transaction.set_rollback(True) return response response = render_to_response("email_change_successful.html", address_context) - transaction.commit() return response - except Exception: # pylint: disable=broad-except - # If we get an unexpected exception, be sure to rollback the transaction - transaction.rollback() - raise @require_POST diff --git a/common/djangoapps/third_party_auth/admin.py b/common/djangoapps/third_party_auth/admin.py index 0897e3e283..c42141da1b 100644 --- a/common/djangoapps/third_party_auth/admin.py +++ b/common/djangoapps/third_party_auth/admin.py @@ -126,6 +126,7 @@ class ApiPermissionsAdminForm(forms.ModelForm): """ Django admin form for ApiPermissions model """ class Meta(object): # pylint: disable=missing-docstring model = ProviderApiPermissions + fields = ['client', 'provider_id'] provider_id = forms.ChoiceField(choices=[], required=True) diff --git a/common/djangoapps/third_party_auth/api/views.py b/common/djangoapps/third_party_auth/api/views.py index ada722849c..d508a73179 100644 --- a/common/djangoapps/third_party_auth/api/views.py +++ b/common/djangoapps/third_party_auth/api/views.py @@ -204,8 +204,8 @@ class UserMappingView(ListAPIView): query = Q() - usernames = self.request.QUERY_PARAMS.getlist('username', None) - remote_ids = self.request.QUERY_PARAMS.getlist('remote_id', None) + usernames = self.request.query_params.getlist('username', None) + remote_ids = self.request.query_params.getlist('remote_id', None) if usernames: usernames = ','.join(usernames) diff --git a/common/djangoapps/third_party_auth/migrations/0001_initial.py b/common/djangoapps/third_party_auth/migrations/0001_initial.py index d4a13a6dc0..9bd9f7aee1 100644 --- a/common/djangoapps/third_party_auth/migrations/0001_initial.py +++ b/common/djangoapps/third_party_auth/migrations/0001_initial.py @@ -1,181 +1,137 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import provider.utils +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'OAuth2ProviderConfig' - db.create_table('third_party_auth_oauth2providerconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('icon_class', self.gf('django.db.models.fields.CharField')(default='fa-sign-in', max_length=50)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('backend_name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('key', self.gf('django.db.models.fields.TextField')(blank=True)), - ('secret', self.gf('django.db.models.fields.TextField')(blank=True)), - ('other_settings', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('third_party_auth', ['OAuth2ProviderConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('oauth2', '0001_initial'), + ] - # Adding model 'SAMLProviderConfig' - db.create_table('third_party_auth_samlproviderconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('icon_class', self.gf('django.db.models.fields.CharField')(default='fa-sign-in', max_length=50)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('backend_name', self.gf('django.db.models.fields.CharField')(default='tpa-saml', max_length=50)), - ('idp_slug', self.gf('django.db.models.fields.SlugField')(max_length=30)), - ('entity_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('metadata_source', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('attr_user_permanent_id', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('attr_full_name', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('attr_first_name', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('attr_last_name', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('attr_username', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('attr_email', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('other_settings', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('third_party_auth', ['SAMLProviderConfig']) - - # Adding model 'SAMLConfiguration' - db.create_table('third_party_auth_samlconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('private_key', self.gf('django.db.models.fields.TextField')()), - ('public_key', self.gf('django.db.models.fields.TextField')()), - ('entity_id', self.gf('django.db.models.fields.CharField')(default='http://saml.example.com', max_length=255)), - ('org_info_str', self.gf('django.db.models.fields.TextField')(default='{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}')), - ('other_config_str', self.gf('django.db.models.fields.TextField')(default='{\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\n}')), - )) - db.send_create_signal('third_party_auth', ['SAMLConfiguration']) - - # Adding model 'SAMLProviderData' - db.create_table('third_party_auth_samlproviderdata', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('fetched_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('expires_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('entity_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('sso_url', self.gf('django.db.models.fields.URLField')(max_length=200)), - ('public_key', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('third_party_auth', ['SAMLProviderData']) - - - def backwards(self, orm): - # Deleting model 'OAuth2ProviderConfig' - db.delete_table('third_party_auth_oauth2providerconfig') - - # Deleting model 'SAMLProviderConfig' - db.delete_table('third_party_auth_samlproviderconfig') - - # Deleting model 'SAMLConfiguration' - db.delete_table('third_party_auth_samlconfiguration') - - # Deleting model 'SAMLProviderData' - db.delete_table('third_party_auth_samlproviderdata') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {}), - 'public_key': ('django.db.models.fields.TextField', [], {}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='LTIProviderConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('icon_class', models.CharField(default=b'fa-sign-in', help_text=b'The Font Awesome (or custom) icon class to use on the login button for this provider. Examples: fa-google-plus, fa-facebook, fa-linkedin, fa-sign-in, fa-university', max_length=50)), + ('name', models.CharField(help_text=b'Name of this provider (shown to users)', max_length=50)), + ('secondary', models.BooleanField(default=False, help_text='Secondary providers are displayed less prominently, in a separate list of "Institution" login providers.')), + ('skip_registration_form', models.BooleanField(default=False, help_text='If this option is enabled, users will not be asked to confirm their details (name, email, etc.) during the registration process. Only select this option for trusted providers that are known to provide accurate user information.')), + ('skip_email_verification', models.BooleanField(default=False, help_text='If this option is selected, users will not be required to confirm their email, and their account will be activated immediately upon registration.')), + ('lti_consumer_key', models.CharField(help_text=b'The name that the LTI Tool Consumer will use to identify itself', max_length=255)), + ('lti_hostname', models.CharField(default=b'localhost', help_text=b'The domain that will be acting as the LTI consumer.', max_length=255, db_index=True)), + ('lti_consumer_secret', models.CharField(default=provider.utils.long_token, help_text=b'The shared secret that the LTI Tool Consumer will use to authenticate requests. Only this edX instance and this tool consumer instance should know this value. For increased security, you can avoid storing this in your database by leaving this field blank and setting SOCIAL_AUTH_LTI_CONSUMER_SECRETS = {"consumer key": "secret", ...} in your instance\'s Django setttigs (or lms.auth.json)', max_length=255, blank=True)), + ('lti_max_timestamp_age', models.IntegerField(default=10, help_text=b'The maximum age of oauth_timestamp values, in seconds.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'verbose_name': 'Provider Configuration (LTI)', + 'verbose_name_plural': 'Provider Configuration (LTI)', + }, + ), + migrations.CreateModel( + name='OAuth2ProviderConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('icon_class', models.CharField(default=b'fa-sign-in', help_text=b'The Font Awesome (or custom) icon class to use on the login button for this provider. Examples: fa-google-plus, fa-facebook, fa-linkedin, fa-sign-in, fa-university', max_length=50)), + ('name', models.CharField(help_text=b'Name of this provider (shown to users)', max_length=50)), + ('secondary', models.BooleanField(default=False, help_text='Secondary providers are displayed less prominently, in a separate list of "Institution" login providers.')), + ('skip_registration_form', models.BooleanField(default=False, help_text='If this option is enabled, users will not be asked to confirm their details (name, email, etc.) during the registration process. Only select this option for trusted providers that are known to provide accurate user information.')), + ('skip_email_verification', models.BooleanField(default=False, help_text='If this option is selected, users will not be required to confirm their email, and their account will be activated immediately upon registration.')), + ('backend_name', models.CharField(help_text=b'Which python-social-auth OAuth2 provider backend to use. The list of backend choices is determined by the THIRD_PARTY_AUTH_BACKENDS setting.', max_length=50, db_index=True)), + ('key', models.TextField(verbose_name=b'Client ID', blank=True)), + ('secret', models.TextField(help_text=b'For increased security, you can avoid storing this in your database by leaving this field blank and setting SOCIAL_AUTH_OAUTH_SECRETS = {"(backend name)": "secret", ...} in your instance\'s Django settings (or lms.auth.json)', verbose_name=b'Client Secret', blank=True)), + ('other_settings', models.TextField(help_text=b'Optional JSON object with advanced settings, if any.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'verbose_name': 'Provider Configuration (OAuth)', + 'verbose_name_plural': 'Provider Configuration (OAuth)', + }, + ), + migrations.CreateModel( + name='ProviderApiPermissions', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('provider_id', models.CharField(help_text=b'Uniquely identify a provider. This is different from backend_name.', max_length=255)), + ('client', models.ForeignKey(to='oauth2.Client')), + ], + options={ + 'verbose_name': 'Provider API Permission', + 'verbose_name_plural': 'Provider API Permissions', + }, + ), + migrations.CreateModel( + name='SAMLConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('private_key', models.TextField(help_text=b'To generate a key pair as two files, run "openssl req -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.key". Paste the contents of saml.key here. For increased security, you can avoid storing this in your database by leaving this field blank and setting it via the SOCIAL_AUTH_SAML_SP_PRIVATE_KEY setting in your instance\'s Django settings (or lms.auth.json).', blank=True)), + ('public_key', models.TextField(help_text=b"Public key certificate. For increased security, you can avoid storing this in your database by leaving this field blank and setting it via the SOCIAL_AUTH_SAML_SP_PUBLIC_CERT setting in your instance's Django settings (or lms.auth.json).", blank=True)), + ('entity_id', models.CharField(default=b'http://saml.example.com', max_length=255, verbose_name=b'Entity ID')), + ('org_info_str', models.TextField(default=b'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}', help_text=b"JSON dictionary of 'url', 'displayname', and 'name' for each language", verbose_name=b'Organization Info')), + ('other_config_str', models.TextField(default=b'{\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\n}', help_text=b'JSON object defining advanced settings that are passed on to python-saml. Valid keys that can be set here include: SECURITY_CONFIG and SP_EXTRA')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'verbose_name': 'SAML Configuration', + 'verbose_name_plural': 'SAML Configuration', + }, + ), + migrations.CreateModel( + name='SAMLProviderConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('icon_class', models.CharField(default=b'fa-sign-in', help_text=b'The Font Awesome (or custom) icon class to use on the login button for this provider. Examples: fa-google-plus, fa-facebook, fa-linkedin, fa-sign-in, fa-university', max_length=50)), + ('name', models.CharField(help_text=b'Name of this provider (shown to users)', max_length=50)), + ('secondary', models.BooleanField(default=False, help_text='Secondary providers are displayed less prominently, in a separate list of "Institution" login providers.')), + ('skip_registration_form', models.BooleanField(default=False, help_text='If this option is enabled, users will not be asked to confirm their details (name, email, etc.) during the registration process. Only select this option for trusted providers that are known to provide accurate user information.')), + ('skip_email_verification', models.BooleanField(default=False, help_text='If this option is selected, users will not be required to confirm their email, and their account will be activated immediately upon registration.')), + ('backend_name', models.CharField(default=b'tpa-saml', help_text=b"Which python-social-auth provider backend to use. 'tpa-saml' is the standard edX SAML backend.", max_length=50)), + ('idp_slug', models.SlugField(help_text=b'A short string uniquely identifying this provider. Cannot contain spaces and should be a usable as a CSS class. Examples: "ubc", "mit-staging"', max_length=30)), + ('entity_id', models.CharField(help_text=b'Example: https://idp.testshib.org/idp/shibboleth', max_length=255, verbose_name=b'Entity ID')), + ('metadata_source', models.CharField(help_text=b"URL to this provider's XML metadata. Should be an HTTPS URL. Example: https://www.testshib.org/metadata/testshib-providers.xml", max_length=255)), + ('attr_user_permanent_id', models.CharField(help_text=b'URN of the SAML attribute that we can use as a unique, persistent user ID. Leave blank for default.', max_length=128, verbose_name=b'User ID Attribute', blank=True)), + ('attr_full_name', models.CharField(help_text=b"URN of SAML attribute containing the user's full name. Leave blank for default.", max_length=128, verbose_name=b'Full Name Attribute', blank=True)), + ('attr_first_name', models.CharField(help_text=b"URN of SAML attribute containing the user's first name. Leave blank for default.", max_length=128, verbose_name=b'First Name Attribute', blank=True)), + ('attr_last_name', models.CharField(help_text=b"URN of SAML attribute containing the user's last name. Leave blank for default.", max_length=128, verbose_name=b'Last Name Attribute', blank=True)), + ('attr_username', models.CharField(help_text=b'URN of SAML attribute to use as a suggested username for this user. Leave blank for default.', max_length=128, verbose_name=b'Username Hint Attribute', blank=True)), + ('attr_email', models.CharField(help_text=b"URN of SAML attribute containing the user's email address[es]. Leave blank for default.", max_length=128, verbose_name=b'Email Attribute', blank=True)), + ('other_settings', models.TextField(help_text=b'For advanced use cases, enter a JSON object with addtional configuration. The tpa-saml backend supports only {"requiredEntitlements": ["urn:..."]} which can be used to require the presence of a specific eduPersonEntitlement.', verbose_name=b'Advanced settings', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'verbose_name': 'Provider Configuration (SAML IdP)', + 'verbose_name_plural': 'Provider Configuration (SAML IdPs)', + }, + ), + migrations.CreateModel( + name='SAMLProviderData', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('fetched_at', models.DateTimeField(db_index=True)), + ('expires_at', models.DateTimeField(null=True, db_index=True)), + ('entity_id', models.CharField(max_length=255, db_index=True)), + ('sso_url', models.URLField(verbose_name=b'SSO URL')), + ('public_key', models.TextField()), + ], + options={ + 'ordering': ('-fetched_at',), + 'verbose_name': 'SAML Provider Data', + 'verbose_name_plural': 'SAML Provider Data', + }, + ), + ] diff --git a/common/djangoapps/third_party_auth/migrations/0002_convert_settings.py b/common/djangoapps/third_party_auth/migrations/0002_convert_settings.py deleted file mode 100644 index a5c38bca81..0000000000 --- a/common/djangoapps/third_party_auth/migrations/0002_convert_settings.py +++ /dev/null @@ -1,141 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf import settings -import json -from south.v2 import DataMigration - - -class Migration(DataMigration): - - def forwards(self, orm): - """ Convert from the THIRD_PARTY_AUTH setting to OAuth2ProviderConfig """ - tpa = getattr(settings, 'THIRD_PARTY_AUTH_OLD_CONFIG', {}) - if tpa and not any(orm.OAuth2ProviderConfig.objects.all()): - print("Migrating third party auth config to OAuth2ProviderConfig") - providers = ( - # Name, backend, icon, prefix - ('Google', 'google-oauth2', 'fa-google-plus', 'SOCIAL_AUTH_GOOGLE_OAUTH2_'), - ('LinkedIn', 'linkedin-oauth2', 'fa-linkedin', 'SOCIAL_AUTH_LINKEDIN_OAUTH2_'), - ('Facebook', 'facebook', 'fa-facebook', 'SOCIAL_AUTH_FACEBOOK_'), - ) - for name, backend, icon, prefix in providers: - if name in tpa: - conf = tpa[name] - conf = {key.replace(prefix, ''): val for key, val in conf.items()} - key = conf.pop('KEY', '') - secret = conf.pop('SECRET', '') - orm.OAuth2ProviderConfig.objects.create( - enabled=True, - name=name, - backend_name=backend, - icon_class=icon, - key=key, - secret=secret, - other_settings=json.dumps(conf), - changed_by=None, - ) - print( - "Done. Make changes via /admin/third_party_auth/oauth2providerconfig/ " - "from now on. You can remove THIRD_PARTY_AUTH from ~/lms.auth.json" - ) - else: - print("Not migrating third party auth config to OAuth2ProviderConfig.") - - def backwards(self, orm): - """ No backwards migration necessary """ - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {}), - 'public_key': ('django.db.models.fields.TextField', [], {}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] - symmetrical = True diff --git a/common/djangoapps/third_party_auth/migrations/0003_add_config_options.py b/common/djangoapps/third_party_auth/migrations/0003_add_config_options.py deleted file mode 100644 index 6ff8a3d3a5..0000000000 --- a/common/djangoapps/third_party_auth/migrations/0003_add_config_options.py +++ /dev/null @@ -1,161 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SAMLProviderConfig.secondary' - db.add_column('third_party_auth_samlproviderconfig', 'secondary', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'SAMLProviderConfig.skip_registration_form' - db.add_column('third_party_auth_samlproviderconfig', 'skip_registration_form', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'SAMLProviderConfig.skip_email_verification' - db.add_column('third_party_auth_samlproviderconfig', 'skip_email_verification', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'OAuth2ProviderConfig.secondary' - db.add_column('third_party_auth_oauth2providerconfig', 'secondary', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'OAuth2ProviderConfig.skip_registration_form' - db.add_column('third_party_auth_oauth2providerconfig', 'skip_registration_form', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'OAuth2ProviderConfig.skip_email_verification' - db.add_column('third_party_auth_oauth2providerconfig', 'skip_email_verification', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SAMLProviderConfig.secondary' - db.delete_column('third_party_auth_samlproviderconfig', 'secondary') - - # Deleting field 'SAMLProviderConfig.skip_registration_form' - db.delete_column('third_party_auth_samlproviderconfig', 'skip_registration_form') - - # Deleting field 'SAMLProviderConfig.skip_email_verification' - db.delete_column('third_party_auth_samlproviderconfig', 'skip_email_verification') - - # Deleting field 'OAuth2ProviderConfig.secondary' - db.delete_column('third_party_auth_oauth2providerconfig', 'secondary') - - # Deleting field 'OAuth2ProviderConfig.skip_registration_form' - db.delete_column('third_party_auth_oauth2providerconfig', 'skip_registration_form') - - # Deleting field 'OAuth2ProviderConfig.skip_email_verification' - db.delete_column('third_party_auth_oauth2providerconfig', 'skip_email_verification') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {}), - 'public_key': ('django.db.models.fields.TextField', [], {}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] \ No newline at end of file diff --git a/common/djangoapps/third_party_auth/migrations/0004_lti_tool_consumers.py b/common/djangoapps/third_party_auth/migrations/0004_lti_tool_consumers.py deleted file mode 100644 index dfef06ae73..0000000000 --- a/common/djangoapps/third_party_auth/migrations/0004_lti_tool_consumers.py +++ /dev/null @@ -1,149 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=C,E,F,R,W -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LTIProviderConfig' - db.create_table('third_party_auth_ltiproviderconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('icon_class', self.gf('django.db.models.fields.CharField')(default='fa-sign-in', max_length=50)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('secondary', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('skip_registration_form', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('skip_email_verification', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('lti_consumer_key', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('lti_consumer_secret', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('lti_max_timestamp_age', self.gf('django.db.models.fields.IntegerField')(default=10)), - )) - db.send_create_signal('third_party_auth', ['LTIProviderConfig']) - - - def backwards(self, orm): - # Deleting model 'LTIProviderConfig' - db.delete_table('third_party_auth_ltiproviderconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'third_party_auth.ltiproviderconfig': { - 'Meta': {'object_name': 'LTIProviderConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lti_consumer_key': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'lti_consumer_secret': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'lti_max_timestamp_age': ('django.db.models.fields.IntegerField', [], {'default': '10'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {}), - 'public_key': ('django.db.models.fields.TextField', [], {}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] diff --git a/common/djangoapps/third_party_auth/migrations/0005_auto__add_field_ltiproviderconfig_lti_hostname.py b/common/djangoapps/third_party_auth/migrations/0005_auto__add_field_ltiproviderconfig_lti_hostname.py deleted file mode 100644 index 87c09fc129..0000000000 --- a/common/djangoapps/third_party_auth/migrations/0005_auto__add_field_ltiproviderconfig_lti_hostname.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'LTIProviderConfig.lti_hostname' - db.add_column('third_party_auth_ltiproviderconfig', 'lti_hostname', - self.gf('django.db.models.fields.CharField')(default='localhost', max_length=255, db_index=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'LTIProviderConfig.lti_hostname' - db.delete_column('third_party_auth_ltiproviderconfig', 'lti_hostname') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'third_party_auth.ltiproviderconfig': { - 'Meta': {'object_name': 'LTIProviderConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lti_consumer_key': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'lti_consumer_secret': ('django.db.models.fields.CharField', [], {'default': "'ae8c9adcb7764ad67272c57c602dabd0b71acf22'", 'max_length': '255', 'blank': 'True'}), - 'lti_hostname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'lti_max_timestamp_age': ('django.db.models.fields.IntegerField', [], {'default': '10'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] \ No newline at end of file diff --git a/common/djangoapps/third_party_auth/migrations/0006_add_api_permission.py b/common/djangoapps/third_party_auth/migrations/0006_add_api_permission.py deleted file mode 100644 index 9658dcbc89..0000000000 --- a/common/djangoapps/third_party_auth/migrations/0006_add_api_permission.py +++ /dev/null @@ -1,156 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'ProviderApiPermissions' - db.create_table('third_party_auth_providerapipermissions', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('client', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oauth2.Client'])), - ('provider_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal('third_party_auth', ['ProviderApiPermissions']) - - - def backwards(self, orm): - # Deleting model 'ProviderApiPermissions' - db.delete_table('third_party_auth_providerapipermissions') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'oauth2.client': { - 'Meta': {'object_name': 'Client'}, - 'client_id': ('django.db.models.fields.CharField', [], {'default': "'d9843a249e3f607e3177'", 'max_length': '255'}), - 'client_secret': ('django.db.models.fields.CharField', [], {'default': "'4009d3b78cee9c0144da4a47a11e2186c6a46d4c'", 'max_length': '255'}), - 'client_type': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'redirect_uri': ('django.db.models.fields.URLField', [], {'max_length': '200'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'oauth2_client'", 'null': 'True', 'to': "orm['auth.User']"}) - }, - 'third_party_auth.providerapipermissions': { - 'Meta': {'object_name': 'ProviderApiPermissions'}, - 'client': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oauth2.Client']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'third_party_auth.ltiproviderconfig': { - 'Meta': {'object_name': 'LTIProviderConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lti_consumer_key': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'lti_consumer_secret': ('django.db.models.fields.CharField', [], {'default': "'011ecd0d33af228631f68d89b335cd6303c00508'", 'max_length': '255', 'blank': 'True'}), - 'lti_max_timestamp_age': ('django.db.models.fields.IntegerField', [], {'default': '10'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.oauth2providerconfig': { - 'Meta': {'object_name': 'OAuth2ProviderConfig'}, - 'backend_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlconfiguration': { - 'Meta': {'object_name': 'SAMLConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'default': "'http://saml.example.com'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'org_info_str': ('django.db.models.fields.TextField', [], {'default': '\'{"en-US": {"url": "http://www.example.com", "displayname": "Example Inc.", "name": "example"}}\''}), - 'other_config_str': ('django.db.models.fields.TextField', [], {'default': '\'{\\n"SECURITY_CONFIG": {"metadataCacheDuration": 604800, "signMetadata": false}\\n}\''}), - 'private_key': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'third_party_auth.samlproviderconfig': { - 'Meta': {'object_name': 'SAMLProviderConfig'}, - 'attr_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_user_permanent_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'attr_username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'backend_name': ('django.db.models.fields.CharField', [], {'default': "'tpa-saml'", 'max_length': '50'}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'icon_class': ('django.db.models.fields.CharField', [], {'default': "'fa-sign-in'", 'max_length': '50'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'idp_slug': ('django.db.models.fields.SlugField', [], {'max_length': '30'}), - 'metadata_source': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'other_settings': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'secondary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_email_verification': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'skip_registration_form': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'third_party_auth.samlproviderdata': { - 'Meta': {'ordering': "('-fetched_at',)", 'object_name': 'SAMLProviderData'}, - 'entity_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'fetched_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'public_key': ('django.db.models.fields.TextField', [], {}), - 'sso_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['third_party_auth'] \ No newline at end of file diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index da06f6ecfc..267d9648e3 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -106,6 +106,7 @@ class ProviderConfig(ConfigurationModel): # "enabled" field is inherited from ConfigurationModel class Meta(object): + app_label = "third_party_auth" abstract = True @property @@ -213,6 +214,7 @@ class OAuth2ProviderConfig(ProviderConfig): other_settings = models.TextField(blank=True, help_text="Optional JSON object with advanced settings, if any.") class Meta(object): + app_label = "third_party_auth" verbose_name = "Provider Configuration (OAuth)" verbose_name_plural = verbose_name @@ -292,6 +294,7 @@ class SAMLProviderConfig(ProviderConfig): self.other_settings = clean_json(self.other_settings, dict) class Meta(object): + app_label = "third_party_auth" verbose_name = "Provider Configuration (SAML IdP)" verbose_name_plural = "Provider Configuration (SAML IdPs)" @@ -387,6 +390,7 @@ class SAMLConfiguration(ConfigurationModel): ) class Meta(object): + app_label = "third_party_auth" verbose_name = "SAML Configuration" verbose_name_plural = verbose_name @@ -453,6 +457,7 @@ class SAMLProviderData(models.Model): public_key = models.TextField() class Meta(object): + app_label = "third_party_auth" verbose_name = "SAML Provider Data" verbose_name_plural = verbose_name ordering = ('-fetched_at', ) @@ -508,6 +513,7 @@ class LTIProviderConfig(ProviderConfig): ) lti_hostname = models.CharField( + default='localhost', max_length=255, help_text=( 'The domain that will be acting as the LTI consumer.' @@ -565,6 +571,7 @@ class LTIProviderConfig(ProviderConfig): return getattr(settings, 'SOCIAL_AUTH_LTI_CONSUMER_SECRETS', {}).get(self.lti_consumer_key, '') class Meta(object): + app_label = "third_party_auth" verbose_name = "Provider Configuration (LTI)" verbose_name_plural = verbose_name @@ -584,5 +591,6 @@ class ProviderApiPermissions(models.Model): ) class Meta(object): # pylint: disable=missing-docstring + app_label = "third_party_auth" verbose_name = "Provider API Permission" verbose_name_plural = verbose_name + 's' diff --git a/common/djangoapps/third_party_auth/settings.py b/common/djangoapps/third_party_auth/settings.py index d6f75a3820..a9864e203a 100644 --- a/common/djangoapps/third_party_auth/settings.py +++ b/common/djangoapps/third_party_auth/settings.py @@ -24,12 +24,6 @@ def apply_settings(django_settings): # Params not in this whitelist will be silently dropped. django_settings.FIELDS_STORED_IN_SESSION = _FIELDS_STORED_IN_SESSION - # Register and configure python-social-auth with Django. - django_settings.INSTALLED_APPS += ( - 'social.apps.django_app.default', - 'third_party_auth', - ) - # Inject exception middleware to make redirects fire. django_settings.MIDDLEWARE_CLASSES += _MIDDLEWARE_CLASSES @@ -86,7 +80,7 @@ def apply_settings(django_settings): # Context processors required under Django. django_settings.SOCIAL_AUTH_UUID_LENGTH = 4 - django_settings.TEMPLATE_CONTEXT_PROCESSORS += ( + django_settings.DEFAULT_TEMPLATE_ENGINE['OPTIONS']['context_processors'] += ( 'social.apps.django_app.context_processors.backends', 'social.apps.django_app.context_processors.login_redirect', ) diff --git a/common/djangoapps/third_party_auth/tests/test_settings.py b/common/djangoapps/third_party_auth/tests/test_settings.py index 9108ce9c66..9b5943c62d 100644 --- a/common/djangoapps/third_party_auth/tests/test_settings.py +++ b/common/djangoapps/third_party_auth/tests/test_settings.py @@ -13,9 +13,14 @@ _SETTINGS_MAP = { 'AUTHENTICATION_BACKENDS': _ORIGINAL_AUTHENTICATION_BACKENDS, 'INSTALLED_APPS': _ORIGINAL_INSTALLED_APPS, 'MIDDLEWARE_CLASSES': _ORIGINAL_MIDDLEWARE_CLASSES, - 'TEMPLATE_CONTEXT_PROCESSORS': _ORIGINAL_TEMPLATE_CONTEXT_PROCESSORS, + 'TEMPLATES': [{ + 'OPTIONS': { + 'context_processors': _ORIGINAL_TEMPLATE_CONTEXT_PROCESSORS + } + }], 'FEATURES': {}, } +_SETTINGS_MAP['DEFAULT_TEMPLATE_ENGINE'] = _SETTINGS_MAP['TEMPLATES'][0] class SettingsUnitTest(testutil.TestCase): @@ -39,10 +44,6 @@ class SettingsUnitTest(testutil.TestCase): settings.apply_settings(self.settings) self.assertEqual(settings._FIELDS_STORED_IN_SESSION, self.settings.FIELDS_STORED_IN_SESSION) - def test_apply_settings_adds_third_party_auth_to_installed_apps(self): - settings.apply_settings(self.settings) - self.assertIn('third_party_auth', self.settings.INSTALLED_APPS) - @unittest.skipUnless(testutil.AUTH_FEATURE_ENABLED, 'third_party_auth not enabled') def test_apply_settings_enables_no_providers_by_default(self): # Providers are only enabled via ConfigurationModels in the database diff --git a/common/djangoapps/track/migrations/0001_initial.py b/common/djangoapps/track/migrations/0001_initial.py index 6ec146dd10..99ed7dce89 100644 --- a/common/djangoapps/track/migrations/0001_initial.py +++ b/common/djangoapps/track/migrations/0001_initial.py @@ -1,48 +1,32 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'TrackingLog' - db.create_table('track_trackinglog', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('dtcreated', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)), - ('ip', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)), - ('event_source', self.gf('django.db.models.fields.CharField')(max_length=32)), - ('event_type', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)), - ('event', self.gf('django.db.models.fields.TextField')(blank=True)), - ('agent', self.gf('django.db.models.fields.CharField')(max_length=256, blank=True)), - ('page', self.gf('django.db.models.fields.CharField')(max_length=32, null=True, blank=True)), - ('time', self.gf('django.db.models.fields.DateTimeField')()), - )) - db.send_create_signal('track', ['TrackingLog']) + dependencies = [ + ] - - def backwards(self, orm): - # Deleting model 'TrackingLog' - db.delete_table('track_trackinglog') - - - models = { - 'track.trackinglog': { - 'Meta': {'object_name': 'TrackingLog'}, - 'agent': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), - 'dtcreated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'event': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'event_source': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'event_type': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ip': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'page': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}) - } - } - - complete_apps = ['track'] + operations = [ + migrations.CreateModel( + name='TrackingLog', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('dtcreated', models.DateTimeField(auto_now_add=True, verbose_name=b'creation date')), + ('username', models.CharField(max_length=32, blank=True)), + ('ip', models.CharField(max_length=32, blank=True)), + ('event_source', models.CharField(max_length=32)), + ('event_type', models.CharField(max_length=512, blank=True)), + ('event', models.TextField(blank=True)), + ('agent', models.CharField(max_length=256, blank=True)), + ('page', models.CharField(max_length=512, null=True, blank=True)), + ('time', models.DateTimeField(verbose_name=b'event time')), + ('host', models.CharField(max_length=64, blank=True)), + ], + options={ + 'db_table': 'track_trackinglog', + }, + ), + ] diff --git a/common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py b/common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py deleted file mode 100644 index 0bb0cde42e..0000000000 --- a/common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'TrackingLog.host' - db.add_column('track_trackinglog', 'host', - self.gf('django.db.models.fields.CharField')(default='', max_length=64, blank=True), - keep_default=False) - - - # Changing field 'TrackingLog.event_type' - db.alter_column('track_trackinglog', 'event_type', self.gf('django.db.models.fields.CharField')(max_length=512)) - - # Changing field 'TrackingLog.page' - db.alter_column('track_trackinglog', 'page', self.gf('django.db.models.fields.CharField')(max_length=512, null=True)) - - def backwards(self, orm): - # Deleting field 'TrackingLog.host' - db.delete_column('track_trackinglog', 'host') - - - # Changing field 'TrackingLog.event_type' - db.alter_column('track_trackinglog', 'event_type', self.gf('django.db.models.fields.CharField')(max_length=32)) - - # Changing field 'TrackingLog.page' - db.alter_column('track_trackinglog', 'page', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)) - - models = { - 'track.trackinglog': { - 'Meta': {'object_name': 'TrackingLog'}, - 'agent': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), - 'dtcreated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'event': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'event_source': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'event_type': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'host': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ip': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'page': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}) - } - } - - complete_apps = ['track'] diff --git a/common/djangoapps/track/views/__init__.py b/common/djangoapps/track/views/__init__.py index 3babc9c9df..b3b18bf498 100644 --- a/common/djangoapps/track/views/__init__.py +++ b/common/djangoapps/track/views/__init__.py @@ -41,17 +41,18 @@ def _get_request_ip(request, default=''): def _get_request_value(request, value_name, default=''): - """Helper method to get header values from a request's REQUEST dict, if present.""" - if request is not None and hasattr(request, 'REQUEST') and value_name in request.REQUEST: - return request.REQUEST[value_name] - else: - return default + """Helper method to get header values from a request's GET/POST dict, if present.""" + if request is not None: + if request.method == 'GET': + return request.GET.get(value_name, default) + elif request.method == 'POST': + return request.POST.get(value_name, default) + return default def user_track(request): """ - Log when POST call to "event" URL is made by a user. Uses request.REQUEST - to allow for GET calls. + Log when POST call to "event" URL is made by a user. GET or POST call should provide "event_type", "event", and "page" arguments. """ diff --git a/common/djangoapps/util/cache.py b/common/djangoapps/util/cache.py index 1e50ac8589..5b912ec3e4 100644 --- a/common/djangoapps/util/cache.py +++ b/common/djangoapps/util/cache.py @@ -17,7 +17,7 @@ from django.core import cache from django.utils.translation import get_language try: - cache = cache.get_cache('general') + cache = cache.caches['general'] # pylint: disable=invalid-name except Exception: cache = cache.cache diff --git a/common/djangoapps/util/db.py b/common/djangoapps/util/db.py index 15442b3243..75264a6666 100644 --- a/common/djangoapps/util/db.py +++ b/common/djangoapps/util/db.py @@ -1,47 +1,222 @@ """ Utility functions related to databases. """ +# TransactionManagementError used below actually *does* derive from the standard "Exception" class. +# pylint: disable=nonstandard-exception from functools import wraps import random -from django.db import connection, transaction +from django.db import DEFAULT_DB_ALIAS, DatabaseError, Error, transaction MYSQL_MAX_INT = (2 ** 31) - 1 -def commit_on_success_with_read_committed(func): # pylint: disable=invalid-name +class CommitOnSuccessManager(object): """ - Decorator which executes the decorated function inside a transaction with isolation level set to READ COMMITTED. + This class implements the commit_on_success() API that was available till Django 1.5. - If the function returns a response the transaction is committed and if the function raises an exception the - transaction is rolled back. + An instance can be used either as a decorator or as a context manager. However, it + cannot be nested inside an atomic block. - Raises TransactionManagementError if there are already more than 1 level of transactions open. + It is mostly taken from https://github.com/django/django/blob/1.8.5/django/db/transaction.py#L110-L277 + but instead of using save points commits all pending queries at the end of a block. - Note: This only works on MySQL. + The goal is to behave as close as possible to: + https://github.com/django/django/blob/1.4.22/django/db/transaction.py#L263-L289 """ - @wraps(func) - def wrapper(*args, **kwargs): # pylint: disable=missing-docstring - if connection.vendor == 'mysql': - # The isolation level cannot be changed while a transaction is in progress. So we close any existing one. - if connection.transaction_state: - if len(connection.transaction_state) == 1: - connection.commit() - # We can commit all open transactions. But it does not seem like a good idea. - elif len(connection.transaction_state) > 1: - raise transaction.TransactionManagementError('Cannot change isolation level. ' - 'More than 1 level of nested transactions.') + # Tests in TestCase subclasses are wrapped in an atomic block to speed up database restoration. + # So we must disabled this manager. + # https://github.com/django/django/blob/1.8.5/django/core/handlers/base.py#L129-L132 + ENABLED = True + + def __init__(self, using, read_committed=False): + self.using = using + self.read_committed = read_committed + + def __enter__(self): + + if not self.ENABLED: + return + + connection = transaction.get_connection(self.using) + + if connection.in_atomic_block: + raise transaction.TransactionManagementError('Cannot be inside an atomic block.') + + if getattr(connection, 'commit_on_success_block_level', 0) == 0: + connection.commit_on_success_block_level = 1 # This will set the transaction isolation level to READ COMMITTED for the next transaction. - cursor = connection.cursor() - cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED") + if self.read_committed is True: + if connection.vendor == 'mysql': + cursor = connection.cursor() + cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED") - with transaction.commit_on_success(): - return func(*args, **kwargs) + # We aren't in a transaction yet; create one. + # The usual way to start a transaction is to turn autocommit off. + # However, some database adapters (namely sqlite3) don't handle + # transactions and savepoints properly when autocommit is off. + # In such cases, start an explicit transaction instead, which has + # the side-effect of disabling autocommit. + if connection.features.autocommits_when_autocommit_is_off: + connection._start_transaction_under_autocommit() # pylint: disable=protected-access + connection.autocommit = False + else: + connection.set_autocommit(False) + else: + if self.read_committed is True: + raise transaction.TransactionManagementError('Cannot change isolation level when nested.') - return wrapper + connection.commit_on_success_block_level += 1 + + def __exit__(self, exc_type, exc_value, traceback): + + if not self.ENABLED: + return + + connection = transaction.get_connection(self.using) + + try: + if exc_type is None: + # Commit transaction + try: + connection.commit() + except DatabaseError: + try: + connection.rollback() + except Error: + # An error during rollback means that something + # went wrong with the connection. Drop it. + connection.close() + raise + else: + # Roll back transaction + try: + connection.rollback() + except Error: + # An error during rollback means that something + # went wrong with the connection. Drop it. + connection.close() + + finally: + connection.commit_on_success_block_level -= 1 + + # Outermost block exit when autocommit was enabled. + if connection.commit_on_success_block_level == 0: + if connection.features.autocommits_when_autocommit_is_off: + connection.autocommit = True + else: + connection.set_autocommit(True) + + def __call__(self, func): + @wraps(func) + def decorated(*args, **kwds): # pylint: disable=missing-docstring + with self: + return func(*args, **kwds) + return decorated + + +def commit_on_success(using=None, read_committed=False): + """ + This function implements the commit_on_success() API that was available till Django 1.5. + + It can be used either as a decorator or as a context manager. However, it + cannot be nested inside an atomic block. + + If the wrapped function or block returns a response the transaction is committed + and if it raises an exception the transaction is rolled back. + + Arguments: + using (str): the name of the database. + read_committed (bool): Whether to use read committed isolation level. + + Raises: + TransactionManagementError: if already inside an atomic block. + """ + if callable(using): + return CommitOnSuccessManager(DEFAULT_DB_ALIAS, read_committed)(using) + # Decorator: @commit_on_success(...) or context manager: with commit_on_success(...): ... + else: + return CommitOnSuccessManager(using, read_committed) + + +class OuterAtomic(transaction.Atomic): + """ + Atomic which cannot be nested in another atomic. + + This is useful if you want to ensure that a commit happens at + the end of the wrapped block. + """ + ALLOW_NESTED = False + + def __init__(self, using, savepoint, read_committed=False): + self.read_committed = read_committed + super(OuterAtomic, self).__init__(using, savepoint) + + def __enter__(self): + + connection = transaction.get_connection(self.using) + + # TestCase setup nests tests in two atomics - one for the test class and one for the individual test. + # The outermost atomic starts a transaction - so does not have a savepoint. + # The inner atomic starts a savepoint around the test. + # So, for tests only, there should be exactly one savepoint_id and two atomic_for_testcase_calls. + # atomic_for_testcase_calls below is added in a monkey-patch for tests only. + # pylint: disable=no-member + if self.ALLOW_NESTED and (self.atomic_for_testcase_calls - len(connection.savepoint_ids)) < 1: + raise transaction.TransactionManagementError('Cannot be inside an atomic block.') + + # Otherwise, this shouldn't be nested in any atomic block. + if not self.ALLOW_NESTED and connection.in_atomic_block: + raise transaction.TransactionManagementError('Cannot be inside an atomic block.') + + # This will set the transaction isolation level to READ COMMITTED for the next transaction. + if self.read_committed is True: + if connection.vendor == 'mysql': + cursor = connection.cursor() + cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED") + + super(OuterAtomic, self).__enter__() + + +def outer_atomic(using=None, savepoint=True, read_committed=False): + """ + A variant of Django's atomic() which cannot be nested inside another atomic. + + With the upgrade to Django 1.8, all views by default are wrapped + in an atomic block. Because of this, a commit to the database can + only happen once the view returns. This is because nested atomic + blocks use savepoints and the transaction only gets committed when + the outermost atomic block returns. See the official Django docs + for details: https://docs.djangoproject.com/en/1.8/topics/db/transactions/ + + However, in some cases, we need to be able to commit to the + database in the middle of a view. The only way to do this + is to disable automatic transaction management for the view by + adding @transaction.non_atomic_requests to it and then using + atomic() inside it in relevant places. To help ensure that queries + inside a piece of code are committed, you can wrap it in + outer_atomic(). outer_atomic() will ensure that it is not nested + inside another atomic block. + + Additionally, some views need to use READ COMMITTED isolation level. + For this add @transaction.non_atomic_requests and + @outer_atomic(read_committed=True) decorators on it. + + Arguments: + using (str): the name of the database. + read_committed (bool): Whether to use read committed isolation level. + + Raises: + TransactionManagementError: if already inside an atomic block. + """ + if callable(using): + return OuterAtomic(DEFAULT_DB_ALIAS, savepoint, read_committed)(using) + # Decorator: @outer_atomic(...) or context manager: with outer_atomic(...): ... + else: + return OuterAtomic(using, savepoint, read_committed) def generate_int_id(minimum=0, maximum=MYSQL_MAX_INT, used_ids=None): diff --git a/common/djangoapps/util/json_request.py b/common/djangoapps/util/json_request.py index 30eacb9810..8cc188ec2b 100644 --- a/common/djangoapps/util/json_request.py +++ b/common/djangoapps/util/json_request.py @@ -1,11 +1,36 @@ from functools import wraps import json +import decimal from django.core.serializers import serialize from django.core.serializers.json import DjangoJSONEncoder from django.db.models.query import QuerySet from django.http import HttpResponse, HttpResponseBadRequest +class EDXJSONEncoder(DjangoJSONEncoder): + """ + Encoder for Decimal object, other objects will be encoded as per DjangoJSONEncoder default implementation. + + NOTE: + Please see https://docs.djangoproject.com/en/1.8/releases/1.5/#system-version-of-simplejson-no-longer-used + DjangoJSONEncoder will now use the Python's json module but Python's json module don't know about how to + encode Decimal object, so as per default implementation Decimal objects will be encoded to `str` which we don't + want and also this is different from Django 1.4, In Django 1.4 if Decimal object has zeros after the decimal + point then object will be serialized as `int` else `float`, so we are keeping this behavior. + """ + def default(self, o): # pylint: disable=method-hidden + """ + Encode Decimal objects. If decimal object has zeros after the + decimal point then object will be serialized as `int` else `float` + """ + if isinstance(o, decimal.Decimal): + if o == o.to_integral(): + return int(o) + return float(o) + else: + return super(EDXJSONEncoder, self).default(o) + + def expect_json(view_function): """ View decorator for simplifying handing of requests that expect json. If the request's @@ -33,15 +58,15 @@ class JsonResponse(HttpResponse): """ Django HttpResponse subclass that has sensible defaults for outputting JSON. """ - def __init__(self, object=None, status=None, encoder=DjangoJSONEncoder, + def __init__(self, resp_obj=None, status=None, encoder=EDXJSONEncoder, *args, **kwargs): - if object in (None, ""): + if resp_obj in (None, ""): content = "" status = status or 204 - elif isinstance(object, QuerySet): - content = serialize('json', object) + elif isinstance(resp_obj, QuerySet): + content = serialize('json', resp_obj) else: - content = json.dumps(object, cls=encoder, indent=2, ensure_ascii=False) + content = json.dumps(resp_obj, cls=encoder, indent=2, ensure_ascii=False) kwargs.setdefault("content_type", "application/json") if status: kwargs["status"] = status diff --git a/common/djangoapps/util/migrations/0001_initial.py b/common/djangoapps/util/migrations/0001_initial.py index baed557c2c..6880b5da35 100644 --- a/common/djangoapps/util/migrations/0001_initial.py +++ b/common/djangoapps/util/migrations/0001_initial.py @@ -1,72 +1,29 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'RateLimitConfiguration' - db.create_table('util_ratelimitconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('util', ['RateLimitConfiguration']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'RateLimitConfiguration' - db.delete_table('util_ratelimitconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'util.ratelimitconfiguration': { - 'Meta': {'object_name': 'RateLimitConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['util'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='RateLimitConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/common/djangoapps/util/migrations/0002_data__default_rate_limit_config.py b/common/djangoapps/util/migrations/0002_data__default_rate_limit_config.py new file mode 100644 index 0000000000..f2e99c5909 --- /dev/null +++ b/common/djangoapps/util/migrations/0002_data__default_rate_limit_config.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +# Converted from the original South migration 0002_default_rate_limit_config.py + +from django.db import migrations, models + + +def forwards(apps, schema_editor): + """Ensure that rate limiting is enabled by default. """ + RateLimitConfiguration = apps.get_model("util", "RateLimitConfiguration") + db_alias = schema_editor.connection.alias + objects = RateLimitConfiguration.objects.using(db_alias) + if not objects.exists(): + objects.create(enabled=True) + + +class Migration(migrations.Migration): + + dependencies = [ + ('util', '0001_initial'), + ] + + operations = [ + migrations.RunPython(forwards) + ] diff --git a/common/djangoapps/util/migrations/0002_default_rate_limit_config.py b/common/djangoapps/util/migrations/0002_default_rate_limit_config.py deleted file mode 100644 index f15ca5b558..0000000000 --- a/common/djangoapps/util/migrations/0002_default_rate_limit_config.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - - -class Migration(DataMigration): - - def forwards(self, orm): - """Ensure that rate limiting is enabled by default. """ - orm['util.RateLimitConfiguration'].objects.create(enabled=True) - - def backwards(self, orm): - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'util.ratelimitconfiguration': { - 'Meta': {'object_name': 'RateLimitConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['util'] - symmetrical = True diff --git a/common/djangoapps/util/model_utils.py b/common/djangoapps/util/model_utils.py index e0a03bc690..de8e43a7d8 100644 --- a/common/djangoapps/util/model_utils.py +++ b/common/djangoapps/util/model_utils.py @@ -41,9 +41,9 @@ def get_changed_fields_dict(instance, model_class): # an empty dict as a default value. return {} else: - field_names = [ - field[0].name for field in model_class._meta.get_fields_with_model() - ] + # We want to compare all of the scalar fields on the model, but none of + # the relations. + field_names = [f.name for f in model_class._meta.get_fields() if not f.is_relation] # pylint: disable=protected-access changed_fields = { field_name: getattr(old_model, field_name) for field_name in field_names if getattr(old_model, field_name) != getattr(instance, field_name) diff --git a/common/djangoapps/util/models.py b/common/djangoapps/util/models.py index ff353a8039..9cfe1c5fbd 100644 --- a/common/djangoapps/util/models.py +++ b/common/djangoapps/util/models.py @@ -20,7 +20,8 @@ class RateLimitConfiguration(ConfigurationModel): When enabled, it will disable rate limiting on any view decorated with the `can_disable_rate_limit` class decorator. """ - pass + class Meta(ConfigurationModel.Meta): + app_label = "util" def decompress_string(value): @@ -61,13 +62,3 @@ class CompressedTextField(models.TextField): value = decompress_string(value) return value - - def south_field_triple(self): - """Returns a suitable description of this field for South.""" - # We'll just introspect the _actual_ field. - from south.modelsinspector import introspector - - field_class = "django.db.models.fields.TextField" - args, kwargs = introspector(self) - # That's our definition! - return field_class, args, kwargs diff --git a/common/djangoapps/util/testing.py b/common/djangoapps/util/testing.py index a14a4022ed..9abd89ae26 100644 --- a/common/djangoapps/util/testing.py +++ b/common/djangoapps/util/testing.py @@ -9,6 +9,9 @@ from mock import patch from django.conf import settings from django.core.urlresolvers import clear_url_caches, resolve +from django.test import TestCase + +from util.db import OuterAtomic, CommitOnSuccessManager class UrlResetMixin(object): @@ -97,6 +100,7 @@ class EventTestMixin(object): self.mock_tracker.reset_mock() +<<<<<<< HEAD class PatchMediaTypeMixin(object): """ Generic mixin for verifying unsupported media type in PATCH @@ -108,3 +112,51 @@ class PatchMediaTypeMixin(object): content_type=self.unsupported_media_type ) self.assertEqual(response.status_code, 415) +======= +def patch_testcase(): + """ + Disable commit_on_success decorators for tests in TestCase subclasses. + + Since tests in TestCase classes are wrapped in an atomic block, we + cannot use transaction.commit() or transaction.rollback(). + https://docs.djangoproject.com/en/1.8/topics/testing/tools/#django.test.TransactionTestCase + """ + + def enter_atomics_wrapper(wrapped_func): + """ + Wrapper for TestCase._enter_atomics + """ + wrapped_func = wrapped_func.__func__ + + def _wrapper(*args, **kwargs): + """ + Method that performs atomic-entering accounting. + """ + CommitOnSuccessManager.ENABLED = False + OuterAtomic.ALLOW_NESTED = True + if not hasattr(OuterAtomic, 'atomic_for_testcase_calls'): + OuterAtomic.atomic_for_testcase_calls = 0 + OuterAtomic.atomic_for_testcase_calls += 1 + return wrapped_func(*args, **kwargs) + return classmethod(_wrapper) + + def rollback_atomics_wrapper(wrapped_func): + """ + Wrapper for TestCase._rollback_atomics + """ + wrapped_func = wrapped_func.__func__ + + def _wrapper(*args, **kwargs): + """ + Method that performs atomic-rollback accounting. + """ + CommitOnSuccessManager.ENABLED = True + OuterAtomic.ALLOW_NESTED = False + OuterAtomic.atomic_for_testcase_calls -= 1 + return wrapped_func(*args, **kwargs) + return classmethod(_wrapper) + + # pylint: disable=protected-access + TestCase._enter_atomics = enter_atomics_wrapper(TestCase._enter_atomics) + TestCase._rollback_atomics = rollback_atomics_wrapper(TestCase._rollback_atomics) +>>>>>>> origin/release diff --git a/common/djangoapps/util/tests/test_db.py b/common/djangoapps/util/tests/test_db.py index 62326e8a32..603eecd9bb 100644 --- a/common/djangoapps/util/tests/test_db.py +++ b/common/djangoapps/util/tests/test_db.py @@ -7,27 +7,27 @@ import unittest from django.contrib.auth.models import User from django.db import connection, IntegrityError -from django.db.transaction import commit_on_success, TransactionManagementError +from django.db.transaction import atomic, TransactionManagementError from django.test import TestCase, TransactionTestCase -from util.db import commit_on_success_with_read_committed, generate_int_id +from util.db import commit_on_success, generate_int_id, outer_atomic @ddt.ddt -class TransactionIsolationLevelsTestCase(TransactionTestCase): +class TransactionManagersTestCase(TransactionTestCase): """ - Tests the effects of changing transaction isolation level to READ COMMITTED instead of REPEATABLE READ. + Tests commit_on_success and outer_atomic. Note: This TestCase only works with MySQL. - To run it on devstack: - 1. Add TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' to envs/devstack.py - 2. Run "./manage.py lms --settings=devstack test util.tests.test_db" + To test do: "./manage.py lms --settings=test_with_mysql test util.tests.test_db" """ @ddt.data( - (commit_on_success, IntegrityError, None, True), - (commit_on_success_with_read_committed, type(None), False, True), + (outer_atomic(), IntegrityError, None, True), + (outer_atomic(read_committed=True), type(None), False, True), + (commit_on_success(), IntegrityError, None, True), + (commit_on_success(read_committed=True), type(None), False, True), ) @ddt.unpack def test_concurrent_requests(self, transaction_decorator, exception_class, created_in_1, created_in_2): @@ -80,8 +80,11 @@ class TransactionIsolationLevelsTestCase(TransactionTestCase): self.assertIsNone(thread2.status.get('exception')) self.assertEqual(thread2.status.get('created'), created_in_2) - def test_transaction_nesting(self): - """Test that the decorator raises an error if there are already more than 1 levels of nested transactions.""" + def test_outer_atomic_nesting(self): + """ + Test that outer_atomic raises an error if it is nested inside + another atomic. + """ if connection.vendor != 'mysql': raise unittest.SkipTest('Only works on MySQL.') @@ -90,15 +93,46 @@ class TransactionIsolationLevelsTestCase(TransactionTestCase): """Just return.""" return - commit_on_success_with_read_committed(do_nothing)() + outer_atomic()(do_nothing)() - with commit_on_success(): - commit_on_success_with_read_committed(do_nothing)() + with atomic(): + atomic()(do_nothing)() - with self.assertRaises(TransactionManagementError): + with outer_atomic(): + atomic()(do_nothing)() + + with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'): + with atomic(): + outer_atomic()(do_nothing)() + + with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'): + with outer_atomic(): + outer_atomic()(do_nothing)() + + def test_commit_on_success_nesting(self): + """ + Test that commit_on_success raises an error if it is nested inside + atomic or if the isolation level is changed when it is nested + inside another commit_on_success. + """ + # pylint: disable=not-callable + + if connection.vendor != 'mysql': + raise unittest.SkipTest('Only works on MySQL.') + + def do_nothing(): + """Just return.""" + return + + commit_on_success(read_committed=True)(do_nothing)() + + with self.assertRaisesRegexp(TransactionManagementError, 'Cannot change isolation level when nested.'): with commit_on_success(): - with commit_on_success(): - commit_on_success_with_read_committed(do_nothing)() + commit_on_success(read_committed=True)(do_nothing)() + + with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'): + with atomic(): + commit_on_success(read_committed=True)(do_nothing)() @ddt.ddt diff --git a/common/djangoapps/util/tests/test_file.py b/common/djangoapps/util/tests/test_file.py index ae798d080d..0a1b111a8f 100644 --- a/common/djangoapps/util/tests/test_file.py +++ b/common/djangoapps/util/tests/test_file.py @@ -88,7 +88,6 @@ class StoreUploadedFileTestCase(TestCase): super(StoreUploadedFileTestCase, self).setUp() self.request = Mock(spec=HttpRequest) self.file_content = "test file content" - self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} self.stored_file_name = None self.file_storage = None self.default_max_size = 2000000 @@ -109,22 +108,27 @@ class StoreUploadedFileTestCase(TestCase): Verifies that exceptions are thrown in the expected cases. """ with self.assertRaises(ValueError) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file(self.request, "wrong_key", [".txt", ".csv"], "stored_file", self.default_max_size) self.verify_exception("No file uploaded with key 'wrong_key'.", error) with self.assertRaises(exceptions.PermissionDenied) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file(self.request, "uploaded_file", [], "stored_file", self.default_max_size) self.verify_exception("The file must end with one of the following extensions: ''.", error) with self.assertRaises(exceptions.PermissionDenied) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file(self.request, "uploaded_file", [".bar"], "stored_file", self.default_max_size) self.verify_exception("The file must end with the extension '.bar'.", error) with self.assertRaises(exceptions.PermissionDenied) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file(self.request, "uploaded_file", [".xxx", ".bar"], "stored_file", self.default_max_size) self.verify_exception("The file must end with one of the following extensions: '.xxx', '.bar'.", error) with self.assertRaises(exceptions.PermissionDenied) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file(self.request, "uploaded_file", [".csv"], "stored_file", 2) self.verify_exception("Maximum upload file size is 2 bytes.", error) @@ -158,6 +162,7 @@ class StoreUploadedFileTestCase(TestCase): store_file_data(storage, filename) with self.assertRaises(FileValidationException) as error: + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file( self.request, "uploaded_file", [".csv"], "error_file", self.default_max_size, validator=exception_validator @@ -166,6 +171,7 @@ class StoreUploadedFileTestCase(TestCase): # Verify the file was deleted. verify_file_presence(False) + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} store_uploaded_file( self.request, "uploaded_file", [".csv"], "success_file", self.default_max_size, validator=success_validator ) @@ -176,6 +182,7 @@ class StoreUploadedFileTestCase(TestCase): """ Tests uploading a file with lower case extension. Verifies that the stored file contents are correct. """ + self.request.FILES = {"uploaded_file": SimpleUploadedFile("tempfile.csv", self.file_content)} file_storage, stored_file_name = store_uploaded_file( self.request, "uploaded_file", [".csv"], "stored_file", self.default_max_size ) @@ -204,6 +211,7 @@ class StoreUploadedFileTestCase(TestCase): self.request, "nonunique_file", [".txt"], requested_file_name, self.default_max_size ) + self.request.FILES = {"nonunique_file": SimpleUploadedFile("nonunique.txt", file_content)} file_storage, second_stored_file_name = store_uploaded_file( self.request, "nonunique_file", [".txt"], requested_file_name, self.default_max_size ) diff --git a/common/djangoapps/util/tests/test_memcache.py b/common/djangoapps/util/tests/test_memcache.py index 805884012d..939765e3a4 100644 --- a/common/djangoapps/util/tests/test_memcache.py +++ b/common/djangoapps/util/tests/test_memcache.py @@ -3,7 +3,7 @@ Tests for memcache in util app """ from django.test import TestCase -from django.core.cache import get_cache +from django.core.cache import caches from util.memcache import safe_key @@ -18,7 +18,7 @@ class MemcacheTest(TestCase): def setUp(self): super(MemcacheTest, self).setUp() - self.cache = get_cache('default') + self.cache = caches['default'] def test_safe_key(self): key = safe_key('test', 'prefix', 'version') diff --git a/common/djangoapps/util/url.py b/common/djangoapps/util/url.py index c90d83dea2..25250eb2d5 100644 --- a/common/djangoapps/util/url.py +++ b/common/djangoapps/util/url.py @@ -5,7 +5,7 @@ Utility functions related to urls. import sys from django.conf import settings from django.core.urlresolvers import set_urlconf -from django.utils.importlib import import_module +from importlib import import_module def reload_django_url_config(): diff --git a/common/djangoapps/xblock_django/migrations/0001_initial.py b/common/djangoapps/xblock_django/migrations/0001_initial.py index 68485f0196..21231c122a 100644 --- a/common/djangoapps/xblock_django/migrations/0001_initial.py +++ b/common/djangoapps/xblock_django/migrations/0001_initial.py @@ -1,74 +1,30 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'XBlockDisableConfig' - db.create_table('xblock_django_xblockdisableconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('disabled_blocks', self.gf('django.db.models.fields.TextField')(default='', blank=True)), - )) - db.send_create_signal('xblock_django', ['XBlockDisableConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'XBlockDisableConfig' - db.delete_table('xblock_django_xblockdisableconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'xblock_django.xblockdisableconfig': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'XBlockDisableConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'disabled_blocks': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['xblock_django'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='XBlockDisableConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('disabled_blocks', models.TextField(default=b'', help_text='Space-separated list of XBlocks which should not render.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/common/djangoapps/xblock_django/models.py b/common/djangoapps/xblock_django/models.py index 863be4a3a7..d527287307 100644 --- a/common/djangoapps/xblock_django/models.py +++ b/common/djangoapps/xblock_django/models.py @@ -13,6 +13,9 @@ class XBlockDisableConfig(ConfigurationModel): Configuration for disabling 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.') diff --git a/common/djangoapps/xmodule_django/models.py b/common/djangoapps/xmodule_django/models.py index 99268d7e4f..fdf7294f77 100644 --- a/common/djangoapps/xmodule_django/models.py +++ b/common/djangoapps/xmodule_django/models.py @@ -7,8 +7,6 @@ from django.db import models from django.core.exceptions import ValidationError from opaque_keys.edx.keys import CourseKey, UsageKey, BlockTypeKey -from south.modelsinspector import add_introspection_rules - class NoneToEmptyManager(models.Manager): """ @@ -22,7 +20,10 @@ class NoneToEmptyManager(models.Manager): """ super(NoneToEmptyManager, self).__init__() - def get_query_set(self): + def get_queryset(self): + """ + Returns the result of NoneToEmptyQuerySet instead of a regular QuerySet. + """ return NoneToEmptyQuerySet(self.model, using=self._db) @@ -171,9 +172,3 @@ class BlockTypeKeyField(OpaqueKeyField): """ description = "A BlockTypeKey object, saved to the DB in the form of a string." KEY_CLASS = BlockTypeKey - - -add_introspection_rules([], [r"^xmodule_django\.models\.CourseKeyField"]) -add_introspection_rules([], [r"^xmodule_django\.models\.LocationKeyField"]) -add_introspection_rules([], [r"^xmodule_django\.models\.UsageKeyField"]) -add_introspection_rules([], [r"^xmodule_django\.models\.BlockTypeKeyField"]) diff --git a/common/lib/capa/capa/tests/test_responsetypes.py b/common/lib/capa/capa/tests/test_responsetypes.py index 788c551dc2..a3a91e440f 100644 --- a/common/lib/capa/capa/tests/test_responsetypes.py +++ b/common/lib/capa/capa/tests/test_responsetypes.py @@ -57,11 +57,11 @@ class ResponseTest(unittest.TestCase): if self.xml_factory_class: self.xml_factory = self.xml_factory_class() - def build_problem(self, capa_system=None, **kwargs): + def build_problem(self, capa_system=None, **kwargs): # pylint: disable=missing-docstring xml = self.xml_factory.build_xml(**kwargs) return new_loncapa_problem(xml, capa_system=capa_system) - def assert_grade(self, problem, submission, expected_correctness, msg=None): + def assert_grade(self, problem, submission, expected_correctness, msg=None): # pylint: disable=missing-docstring input_dict = {'1_2_1': submission} correct_map = problem.grade_answers(input_dict) if msg is None: @@ -69,11 +69,11 @@ class ResponseTest(unittest.TestCase): else: self.assertEquals(correct_map.get_correctness('1_2_1'), expected_correctness, msg) - def assert_answer_format(self, problem): + def assert_answer_format(self, problem): # pylint: disable=missing-docstring answers = problem.get_question_answers() self.assertTrue(answers['1_2_1'] is not None) - def assert_multiple_grade(self, problem, correct_answers, incorrect_answers): + def assert_multiple_grade(self, problem, correct_answers, incorrect_answers): # pylint: disable=missing-docstring for input_str in correct_answers: result = problem.grade_answers({'1_2_1': input_str}).get_correctness('1_2_1') self.assertEqual(result, 'correct') @@ -109,7 +109,7 @@ class ResponseTest(unittest.TestCase): return str(rand.randint(0, 1e9)) -class MultiChoiceResponseTest(ResponseTest): +class MultiChoiceResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = MultipleChoiceResponseXMLFactory def test_multiple_choice_grade(self): @@ -170,7 +170,7 @@ class MultiChoiceResponseTest(ResponseTest): self.assertAlmostEqual(correct_map.get_npoints('1_2_1'), 0) -class TrueFalseResponseTest(ResponseTest): +class TrueFalseResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = TrueFalseResponseXMLFactory def test_true_false_grade(self): @@ -214,7 +214,7 @@ class TrueFalseResponseTest(ResponseTest): self.assert_grade(problem, ['choice_0'], 'correct') -class ImageResponseTest(ResponseTest): +class ImageResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = ImageResponseXMLFactory def test_rectangle_grade(self): @@ -277,7 +277,7 @@ class ImageResponseTest(ResponseTest): self.assert_answer_format(problem) -class SymbolicResponseTest(ResponseTest): +class SymbolicResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = SymbolicResponseXMLFactory def test_grade_single_input_correct(self): @@ -394,7 +394,7 @@ class SymbolicResponseTest(ResponseTest): ) -class OptionResponseTest(ResponseTest): +class OptionResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = OptionResponseXMLFactory def test_grade(self): @@ -592,7 +592,7 @@ class FormulaResponseTest(ResponseTest): self.assertFalse(problem.responders.values()[0].validate_answer('3*y+2*x')) -class StringResponseTest(ResponseTest): +class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = StringResponseXMLFactory def test_backward_compatibility_for_multiple_answers(self): @@ -947,7 +947,7 @@ class StringResponseTest(ResponseTest): self.assertEqual(hint, self._get_random_number_result(problem.seed)) -class CodeResponseTest(ResponseTest): +class CodeResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = CodeResponseXMLFactory def setUp(self): @@ -1138,7 +1138,7 @@ class CodeResponseTest(ResponseTest): self.assertEquals(output[answer_id]['msg'], u'Invalid grader reply. Please contact the course staff.') -class ChoiceResponseTest(ResponseTest): +class ChoiceResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = ChoiceResponseXMLFactory def test_radio_group_grade(self): @@ -1286,7 +1286,7 @@ class ChoiceResponseTest(ResponseTest): self.assertEqual(correct_map.get_correctness('1_2_1'), 'incorrect') -class JavascriptResponseTest(ResponseTest): +class JavascriptResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = JavascriptResponseXMLFactory def test_grade(self): @@ -1326,7 +1326,7 @@ class JavascriptResponseTest(ResponseTest): ) -class NumericalResponseTest(ResponseTest): +class NumericalResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = NumericalResponseXMLFactory # We blend the line between integration (using evaluator) and exclusively @@ -1640,7 +1640,7 @@ class NumericalResponseTest(ResponseTest): self.assertFalse(responder.validate_answer('fish')) -class CustomResponseTest(ResponseTest): +class CustomResponseTest(ResponseTest): # pylint: disable=missing-docstring xml_factory_class = CustomResponseXMLFactory def test_inline_code(self): diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index f1993e58b1..19b85a36a1 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -417,6 +417,7 @@ class CourseFields(object): ) has_children = True checklists = List( + help=_("Checklist to Follow When Developing a Course"), scope=Scope.settings, default=[ { @@ -787,7 +788,8 @@ class CourseFields(object): "number that you entered when you created the course. To use the course number that you entered when " "you created the course, enter null." ), - scope=Scope.settings + scope=Scope.settings, + default="" ) max_student_enrollments_allowed = Integer( diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index 9f61a4e8d6..7eb9ef8d8d 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -17,7 +17,7 @@ from django.conf import settings if not settings.configured: settings.configure() -from django.core.cache import get_cache, InvalidCacheBackendError +from django.core.cache import caches, InvalidCacheBackendError import django.dispatch import django.utils @@ -152,9 +152,9 @@ def create_modulestore_instance( request_cache = None try: - metadata_inheritance_cache = get_cache('mongo_metadata_inheritance') + metadata_inheritance_cache = caches['mongo_metadata_inheritance'] except InvalidCacheBackendError: - metadata_inheritance_cache = get_cache('default') + metadata_inheritance_cache = caches['default'] if issubclass(class_, MixedModuleStore): _options['create_modulestore_instance'] = create_modulestore_instance @@ -214,7 +214,7 @@ def modulestore(): # should be updated to have a setting that enumerates modulestore # wrappers and then uses that setting to wrap the modulestore in # appropriate wrappers depending on enabled features. - from ccx.modulestore import CCXModulestoreWrapper # pylint: disable=import-error + from lms.djangoapps.ccx.modulestore import CCXModulestoreWrapper _MIXED_MODULESTORE = CCXModulestoreWrapper(_MIXED_MODULESTORE) return _MIXED_MODULESTORE diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py index 739fcf32ea..81dade550e 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py @@ -15,7 +15,7 @@ from time import time from pymongo.errors import DuplicateKeyError # pylint: disable=unused-import try: - from django.core.cache import get_cache, InvalidCacheBackendError + from django.core.cache import caches, InvalidCacheBackendError DJANGO_AVAILABLE = True except ImportError: DJANGO_AVAILABLE = False @@ -32,6 +32,15 @@ from xmodule.modulestore.split_mongo import BlockKey new_contract('BlockData', BlockData) +def get_cache(alias): + """ + Return cache for an `alias` + + Note: The primary purpose of this is to mock the cache in test_split_modulestore.py + """ + return caches[alias] + + def round_power_2(value): """ Return value rounded up to the nearest power of 2. diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py index 5e10752fa7..4c0ee87705 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py @@ -13,7 +13,7 @@ import uuid import ddt from contracts import contract from nose.plugins.attrib import attr -from django.core.cache import get_cache, InvalidCacheBackendError +from django.core.cache import caches, InvalidCacheBackendError from openedx.core.lib import tempdir from xblock.fields import Reference, ReferenceList, ReferenceValueDict @@ -934,7 +934,7 @@ class TestCourseStructureCache(SplitModuleTest): def setUp(self): # use the default cache, since the `course_structure_cache` # is a dummy cache during testing - self.cache = get_cache('default') + self.cache = caches['default'] # make sure we clear the cache before every test... self.cache.clear() diff --git a/common/lib/xmodule/xmodule/static_content.py b/common/lib/xmodule/xmodule/static_content.py index deed93e0c5..dd4fbecbc6 100755 --- a/common/lib/xmodule/xmodule/static_content.py +++ b/common/lib/xmodule/xmodule/static_content.py @@ -186,6 +186,9 @@ def main(): Generate Usage: static_content.py """ + from django.conf import settings + settings.configure() + args = docopt(main.__doc__) root = path(args['']) diff --git a/common/lib/xmodule/xmodule/tests/test_course_metadata_utils.py b/common/lib/xmodule/xmodule/tests/test_course_metadata_utils.py index 6743dcbf4e..5e8d4ec203 100644 --- a/common/lib/xmodule/xmodule/tests/test_course_metadata_utils.py +++ b/common/lib/xmodule/xmodule/tests/test_course_metadata_utils.py @@ -6,7 +6,6 @@ from datetime import timedelta, datetime from unittest import TestCase from django.utils.timezone import UTC -from django.utils.translation import ugettext from xmodule.course_metadata_utils import ( clean_course_key, @@ -105,6 +104,10 @@ class CourseMetadataUtilsTestCase(TestCase): else: raise ValueError("Invalid format string :" + format_string) + def nop_gettext(text): + """Dummy implementation of gettext, so we don't need Django.""" + return text + test_datetime = datetime(1945, 02, 06, 04, 20, 00, tzinfo=UTC()) advertised_start_parsable = "2038-01-19 03:14:07" advertised_start_bad_date = "215-01-01 10:10:10" @@ -158,36 +161,34 @@ class CourseMetadataUtilsTestCase(TestCase): # Test parsable advertised start date. # Expect start datetime to be parsed and formatted back into a string. TestScenario( - (DEFAULT_START_DATE, advertised_start_parsable, 'DATE_TIME', ugettext, mock_strftime_localized), + (DEFAULT_START_DATE, advertised_start_parsable, 'DATE_TIME', nop_gettext, mock_strftime_localized), mock_strftime_localized(Date().from_json(advertised_start_parsable), 'DATE_TIME') + " UTC" ), # Test un-parsable advertised start date. # Expect date parsing to throw a ValueError, and the advertised # start to be returned in Title Case. TestScenario( - (test_datetime, advertised_start_unparsable, 'DATE_TIME', ugettext, mock_strftime_localized), + (test_datetime, advertised_start_unparsable, 'DATE_TIME', nop_gettext, mock_strftime_localized), advertised_start_unparsable.title() ), # Test parsable advertised start date from before January 1, 1900. # Expect mock_strftime_localized to throw a ValueError, and the # advertised start to be returned in Title Case. TestScenario( - (test_datetime, advertised_start_bad_date, 'DATE_TIME', ugettext, mock_strftime_localized), + (test_datetime, advertised_start_bad_date, 'DATE_TIME', nop_gettext, mock_strftime_localized), advertised_start_bad_date.title() ), # Test without advertised start date, but with a set start datetime. # Expect formatted datetime to be returned. TestScenario( - (test_datetime, None, 'SHORT_DATE', ugettext, mock_strftime_localized), + (test_datetime, None, 'SHORT_DATE', nop_gettext, mock_strftime_localized), mock_strftime_localized(test_datetime, 'SHORT_DATE') ), # Test without advertised start date and with default start datetime. # Expect TBD to be returned. TestScenario( - (DEFAULT_START_DATE, None, 'SHORT_DATE', ugettext, mock_strftime_localized), - # Translators: TBD stands for 'To Be Determined' and is used when a course - # does not yet have an announced start date. - ugettext('TBD') + (DEFAULT_START_DATE, None, 'SHORT_DATE', nop_gettext, mock_strftime_localized), + 'TBD' ) ]), FunctionTest(course_end_datetime_text, [ diff --git a/common/test/acceptance/pages/lms/instructor_dashboard.py b/common/test/acceptance/pages/lms/instructor_dashboard.py index 977d391b87..486fa27146 100644 --- a/common/test/acceptance/pages/lms/instructor_dashboard.py +++ b/common/test/acceptance/pages/lms/instructor_dashboard.py @@ -775,8 +775,8 @@ class SpecialExamsPageAttemptsSection(PageObject): url = None def is_browser_on_page(self): - return self.q(css="div.wrap #ui-accordion-proctoring-accordion-header-1[aria-selected=true]").present and\ - self.q(css="#search_attempt_id").present + return (self.q(css="div.wrap #ui-accordion-proctoring-accordion-header-1[aria-selected=true]").present and + self.q(css="#search_attempt_id").present) @property def is_search_text_field_visible(self): diff --git a/common/test/acceptance/tests/discussion/helpers.py b/common/test/acceptance/tests/discussion/helpers.py index 269148b20d..949628d98d 100644 --- a/common/test/acceptance/tests/discussion/helpers.py +++ b/common/test/acceptance/tests/discussion/helpers.py @@ -81,6 +81,7 @@ class CohortTestMixin(object): """ url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + "/cohorts/{}/add".format(cohort_id) data = {"users": username} + course_fixture.headers['Content-type'] = 'application/x-www-form-urlencoded' response = course_fixture.session.post(url, data=data, headers=course_fixture.headers) self.assertTrue(response.ok, "Failed to add user to cohort") diff --git a/common/test/acceptance/tests/lms/test_teams.py b/common/test/acceptance/tests/lms/test_teams.py index b1226e647a..08b96e9c0b 100644 --- a/common/test/acceptance/tests/lms/test_teams.py +++ b/common/test/acceptance/tests/lms/test_teams.py @@ -673,10 +673,7 @@ class BrowseTeamsWithinTopicTest(TeamsTabBase): user_info = AutoAuthPage(self.browser, course_id=self.course_id).visit().user_info self.create_membership(user_info['username'], team['id']) team['open_slots'] = self.max_team_size - i - # Parse last activity date, removing microseconds because - # the Django ORM does not support them. Will be fixed in - # Django 1.8. - team['last_activity_at'] = parse(team['last_activity_at']).replace(microsecond=0) + # Re-authenticate as staff after creating users AutoAuthPage( self.browser, diff --git a/common/test/db_cache/bok_choy_data.json b/common/test/db_cache/bok_choy_data.json deleted file mode 100644 index 74b2c4d675..0000000000 --- a/common/test/db_cache/bok_choy_data.json +++ /dev/null @@ -1 +0,0 @@ -[{"pk": 81, "model": "contenttypes.contenttype", "fields": {"model": "accesstoken", "name": "access token", "app_label": "oauth2"}}, {"pk": 164, "model": "contenttypes.contenttype", "fields": {"model": "aiclassifier", "name": "ai classifier", "app_label": "assessment"}}, {"pk": 163, "model": "contenttypes.contenttype", "fields": {"model": "aiclassifierset", "name": "ai classifier set", "app_label": "assessment"}}, {"pk": 166, "model": "contenttypes.contenttype", "fields": {"model": "aigradingworkflow", "name": "ai grading workflow", "app_label": "assessment"}}, {"pk": 165, "model": "contenttypes.contenttype", "fields": {"model": "aitrainingworkflow", "name": "ai training workflow", "app_label": "assessment"}}, {"pk": 35, "model": "contenttypes.contenttype", "fields": {"model": "anonymoususerid", "name": "anonymous user id", "app_label": "student"}}, {"pk": 84, "model": "contenttypes.contenttype", "fields": {"model": "article", "name": "article", "app_label": "wiki"}}, {"pk": 85, "model": "contenttypes.contenttype", "fields": {"model": "articleforobject", "name": "Article for object", "app_label": "wiki"}}, {"pk": 88, "model": "contenttypes.contenttype", "fields": {"model": "articleplugin", "name": "article plugin", "app_label": "wiki"}}, {"pk": 86, "model": "contenttypes.contenttype", "fields": {"model": "articlerevision", "name": "article revision", "app_label": "wiki"}}, {"pk": 93, "model": "contenttypes.contenttype", "fields": {"model": "articlesubscription", "name": "article subscription", "app_label": "wiki"}}, {"pk": 154, "model": "contenttypes.contenttype", "fields": {"model": "assessment", "name": "assessment", "app_label": "assessment"}}, {"pk": 157, "model": "contenttypes.contenttype", "fields": {"model": "assessmentfeedback", "name": "assessment feedback", "app_label": "assessment"}}, {"pk": 156, "model": "contenttypes.contenttype", "fields": {"model": "assessmentfeedbackoption", "name": "assessment feedback option", "app_label": "assessment"}}, {"pk": 155, "model": "contenttypes.contenttype", "fields": {"model": "assessmentpart", "name": "assessment part", "app_label": "assessment"}}, {"pk": 167, "model": "contenttypes.contenttype", "fields": {"model": "assessmentworkflow", "name": "assessment workflow", "app_label": "workflow"}}, {"pk": 169, "model": "contenttypes.contenttype", "fields": {"model": "assessmentworkflowcancellation", "name": "assessment workflow cancellation", "app_label": "workflow"}}, {"pk": 168, "model": "contenttypes.contenttype", "fields": {"model": "assessmentworkflowstep", "name": "assessment workflow step", "app_label": "workflow"}}, {"pk": 19, "model": "contenttypes.contenttype", "fields": {"model": "association", "name": "association", "app_label": "django_openid_auth"}}, {"pk": 25, "model": "contenttypes.contenttype", "fields": {"model": "association", "name": "association", "app_label": "default"}}, {"pk": 63, "model": "contenttypes.contenttype", "fields": {"model": "badgeassertion", "name": "badge assertion", "app_label": "certificates"}}, {"pk": 64, "model": "contenttypes.contenttype", "fields": {"model": "badgeimageconfiguration", "name": "badge image configuration", "app_label": "certificates"}}, {"pk": 77, "model": "contenttypes.contenttype", "fields": {"model": "brandingapiconfig", "name": "branding api config", "app_label": "branding"}}, {"pk": 76, "model": "contenttypes.contenttype", "fields": {"model": "brandinginfoconfig", "name": "branding info config", "app_label": "branding"}}, {"pk": 61, "model": "contenttypes.contenttype", "fields": {"model": "certificategenerationconfiguration", "name": "certificate generation configuration", "app_label": "certificates"}}, {"pk": 60, "model": "contenttypes.contenttype", "fields": {"model": "certificategenerationcoursesetting", "name": "certificate generation course setting", "app_label": "certificates"}}, {"pk": 62, "model": "contenttypes.contenttype", "fields": {"model": "certificatehtmlviewconfiguration", "name": "certificate html view configuration", "app_label": "certificates"}}, {"pk": 122, "model": "contenttypes.contenttype", "fields": {"model": "certificateitem", "name": "certificate item", "app_label": "shoppingcart"}}, {"pk": 56, "model": "contenttypes.contenttype", "fields": {"model": "certificatewhitelist", "name": "certificate whitelist", "app_label": "certificates"}}, {"pk": 79, "model": "contenttypes.contenttype", "fields": {"model": "client", "name": "client", "app_label": "oauth2"}}, {"pk": 26, "model": "contenttypes.contenttype", "fields": {"model": "code", "name": "code", "app_label": "default"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 22, "model": "contenttypes.contenttype", "fields": {"model": "corsmodel", "name": "cors model", "app_label": "corsheaders"}}, {"pk": 136, "model": "contenttypes.contenttype", "fields": {"model": "country", "name": "country", "app_label": "embargo"}}, {"pk": 137, "model": "contenttypes.contenttype", "fields": {"model": "countryaccessrule", "name": "country access rule", "app_label": "embargo"}}, {"pk": 116, "model": "contenttypes.contenttype", "fields": {"model": "coupon", "name": "coupon", "app_label": "shoppingcart"}}, {"pk": 117, "model": "contenttypes.contenttype", "fields": {"model": "couponredemption", "name": "coupon redemption", "app_label": "shoppingcart"}}, {"pk": 48, "model": "contenttypes.contenttype", "fields": {"model": "courseaccessrole", "name": "course access role", "app_label": "student"}}, {"pk": 138, "model": "contenttypes.contenttype", "fields": {"model": "courseaccessrulehistory", "name": "course access rule history", "app_label": "embargo"}}, {"pk": 75, "model": "contenttypes.contenttype", "fields": {"model": "courseauthorization", "name": "course authorization", "app_label": "bulk_email"}}, {"pk": 71, "model": "contenttypes.contenttype", "fields": {"model": "coursecohort", "name": "course cohort", "app_label": "course_groups"}}, {"pk": 70, "model": "contenttypes.contenttype", "fields": {"model": "coursecohortssettings", "name": "course cohorts settings", "app_label": "course_groups"}}, {"pk": 178, "model": "contenttypes.contenttype", "fields": {"model": "coursecontentmilestone", "name": "course content milestone", "app_label": "milestones"}}, {"pk": 189, "model": "contenttypes.contenttype", "fields": {"model": "coursecreator", "name": "course creator", "app_label": "course_creators"}}, {"pk": 72, "model": "contenttypes.contenttype", "fields": {"model": "courseemail", "name": "course email", "app_label": "bulk_email"}}, {"pk": 74, "model": "contenttypes.contenttype", "fields": {"model": "courseemailtemplate", "name": "course email template", "app_label": "bulk_email"}}, {"pk": 45, "model": "contenttypes.contenttype", "fields": {"model": "courseenrollment", "name": "course enrollment", "app_label": "student"}}, {"pk": 47, "model": "contenttypes.contenttype", "fields": {"model": "courseenrollmentallowed", "name": "course enrollment allowed", "app_label": "student"}}, {"pk": 53, "model": "contenttypes.contenttype", "fields": {"model": "courseenrollmentattribute", "name": "course enrollment attribute", "app_label": "student"}}, {"pk": 177, "model": "contenttypes.contenttype", "fields": {"model": "coursemilestone", "name": "course milestone", "app_label": "milestones"}}, {"pk": 125, "model": "contenttypes.contenttype", "fields": {"model": "coursemode", "name": "course mode", "app_label": "course_modes"}}, {"pk": 126, "model": "contenttypes.contenttype", "fields": {"model": "coursemodesarchive", "name": "course modes archive", "app_label": "course_modes"}}, {"pk": 119, "model": "contenttypes.contenttype", "fields": {"model": "courseregcodeitem", "name": "course reg code item", "app_label": "shoppingcart"}}, {"pk": 120, "model": "contenttypes.contenttype", "fields": {"model": "courseregcodeitemannotation", "name": "course reg code item annotation", "app_label": "shoppingcart"}}, {"pk": 114, "model": "contenttypes.contenttype", "fields": {"model": "courseregistrationcode", "name": "course registration code", "app_label": "shoppingcart"}}, {"pk": 112, "model": "contenttypes.contenttype", "fields": {"model": "courseregistrationcodeinvoiceitem", "name": "course registration code invoice item", "app_label": "shoppingcart"}}, {"pk": 140, "model": "contenttypes.contenttype", "fields": {"model": "coursererunstate", "name": "course rerun state", "app_label": "course_action_state"}}, {"pk": 66, "model": "contenttypes.contenttype", "fields": {"model": "coursesoftware", "name": "course software", "app_label": "licenses"}}, {"pk": 145, "model": "contenttypes.contenttype", "fields": {"model": "coursestructure", "name": "course structure", "app_label": "course_structures"}}, {"pk": 105, "model": "contenttypes.contenttype", "fields": {"model": "courseteam", "name": "course team", "app_label": "teams"}}, {"pk": 106, "model": "contenttypes.contenttype", "fields": {"model": "courseteammembership", "name": "course team membership", "app_label": "teams"}}, {"pk": 68, "model": "contenttypes.contenttype", "fields": {"model": "courseusergroup", "name": "course user group", "app_label": "course_groups"}}, {"pk": 69, "model": "contenttypes.contenttype", "fields": {"model": "courseusergrouppartitiongroup", "name": "course user group partition group", "app_label": "course_groups"}}, {"pk": 172, "model": "contenttypes.contenttype", "fields": {"model": "coursevideo", "name": "course video", "app_label": "edxval"}}, {"pk": 181, "model": "contenttypes.contenttype", "fields": {"model": "creditcourse", "name": "credit course", "app_label": "credit"}}, {"pk": 184, "model": "contenttypes.contenttype", "fields": {"model": "crediteligibility", "name": "credit eligibility", "app_label": "credit"}}, {"pk": 180, "model": "contenttypes.contenttype", "fields": {"model": "creditprovider", "name": "credit provider", "app_label": "credit"}}, {"pk": 186, "model": "contenttypes.contenttype", "fields": {"model": "creditrequest", "name": "credit request", "app_label": "credit"}}, {"pk": 182, "model": "contenttypes.contenttype", "fields": {"model": "creditrequirement", "name": "credit requirement", "app_label": "credit"}}, {"pk": 183, "model": "contenttypes.contenttype", "fields": {"model": "creditrequirementstatus", "name": "credit requirement status", "app_label": "credit"}}, {"pk": 152, "model": "contenttypes.contenttype", "fields": {"model": "criterion", "name": "criterion", "app_label": "assessment"}}, {"pk": 153, "model": "contenttypes.contenttype", "fields": {"model": "criterionoption", "name": "criterion option", "app_label": "assessment"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "crontabschedule", "name": "crontab", "app_label": "djcelery"}}, {"pk": 132, "model": "contenttypes.contenttype", "fields": {"model": "darklangconfig", "name": "dark lang config", "app_label": "dark_lang"}}, {"pk": 49, "model": "contenttypes.contenttype", "fields": {"model": "dashboardconfiguration", "name": "dashboard configuration", "app_label": "student"}}, {"pk": 124, "model": "contenttypes.contenttype", "fields": {"model": "donation", "name": "donation", "app_label": "shoppingcart"}}, {"pk": 123, "model": "contenttypes.contenttype", "fields": {"model": "donationconfiguration", "name": "donation configuration", "app_label": "shoppingcart"}}, {"pk": 133, "model": "contenttypes.contenttype", "fields": {"model": "embargoedcourse", "name": "embargoed course", "app_label": "embargo"}}, {"pk": 134, "model": "contenttypes.contenttype", "fields": {"model": "embargoedstate", "name": "embargoed state", "app_label": "embargo"}}, {"pk": 173, "model": "contenttypes.contenttype", "fields": {"model": "encodedvideo", "name": "encoded video", "app_label": "edxval"}}, {"pk": 51, "model": "contenttypes.contenttype", "fields": {"model": "entranceexamconfiguration", "name": "entrance exam configuration", "app_label": "student"}}, {"pk": 59, "model": "contenttypes.contenttype", "fields": {"model": "examplecertificate", "name": "example certificate", "app_label": "certificates"}}, {"pk": 58, "model": "contenttypes.contenttype", "fields": {"model": "examplecertificateset", "name": "example certificate set", "app_label": "certificates"}}, {"pk": 78, "model": "contenttypes.contenttype", "fields": {"model": "externalauthmap", "name": "external auth map", "app_label": "external_auth"}}, {"pk": 57, "model": "contenttypes.contenttype", "fields": {"model": "generatedcertificate", "name": "generated certificate", "app_label": "certificates"}}, {"pk": 80, "model": "contenttypes.contenttype", "fields": {"model": "grant", "name": "grant", "app_label": "oauth2"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 185, "model": "contenttypes.contenttype", "fields": {"model": "historicalcreditrequest", "name": "historical credit request", "app_label": "credit"}}, {"pk": 130, "model": "contenttypes.contenttype", "fields": {"model": "incoursereverificationconfiguration", "name": "in course reverification configuration", "app_label": "verify_student"}}, {"pk": 65, "model": "contenttypes.contenttype", "fields": {"model": "instructortask", "name": "instructor task", "app_label": "instructor_task"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "intervalschedule", "name": "interval", "app_label": "djcelery"}}, {"pk": 109, "model": "contenttypes.contenttype", "fields": {"model": "invoice", "name": "invoice", "app_label": "shoppingcart"}}, {"pk": 113, "model": "contenttypes.contenttype", "fields": {"model": "invoicehistory", "name": "invoice history", "app_label": "shoppingcart"}}, {"pk": 111, "model": "contenttypes.contenttype", "fields": {"model": "invoiceitem", "name": "invoice item", "app_label": "shoppingcart"}}, {"pk": 110, "model": "contenttypes.contenttype", "fields": {"model": "invoicetransaction", "name": "invoice transaction", "app_label": "shoppingcart"}}, {"pk": 139, "model": "contenttypes.contenttype", "fields": {"model": "ipfilter", "name": "ip filter", "app_label": "embargo"}}, {"pk": 52, "model": "contenttypes.contenttype", "fields": {"model": "languageproficiency", "name": "language proficiency", "app_label": "student"}}, {"pk": 50, "model": "contenttypes.contenttype", "fields": {"model": "linkedinaddtoprofileconfiguration", "name": "linked in add to profile configuration", "app_label": "student"}}, {"pk": 21, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 44, "model": "contenttypes.contenttype", "fields": {"model": "loginfailures", "name": "login failures", "app_label": "student"}}, {"pk": 46, "model": "contenttypes.contenttype", "fields": {"model": "manualenrollmentaudit", "name": "manual enrollment audit", "app_label": "student"}}, {"pk": 15, "model": "contenttypes.contenttype", "fields": {"model": "migrationhistory", "name": "migration history", "app_label": "south"}}, {"pk": 175, "model": "contenttypes.contenttype", "fields": {"model": "milestone", "name": "milestone", "app_label": "milestones"}}, {"pk": 176, "model": "contenttypes.contenttype", "fields": {"model": "milestonerelationshiptype", "name": "milestone relationship type", "app_label": "milestones"}}, {"pk": 141, "model": "contenttypes.contenttype", "fields": {"model": "mobileapiconfig", "name": "mobile api config", "app_label": "mobile_api"}}, {"pk": 18, "model": "contenttypes.contenttype", "fields": {"model": "nonce", "name": "nonce", "app_label": "django_openid_auth"}}, {"pk": 24, "model": "contenttypes.contenttype", "fields": {"model": "nonce", "name": "nonce", "app_label": "default"}}, {"pk": 100, "model": "contenttypes.contenttype", "fields": {"model": "note", "name": "note", "app_label": "notes"}}, {"pk": 97, "model": "contenttypes.contenttype", "fields": {"model": "notification", "name": "notification", "app_label": "django_notify"}}, {"pk": 32, "model": "contenttypes.contenttype", "fields": {"model": "offlinecomputedgrade", "name": "offline computed grade", "app_label": "courseware"}}, {"pk": 33, "model": "contenttypes.contenttype", "fields": {"model": "offlinecomputedgradelog", "name": "offline computed grade log", "app_label": "courseware"}}, {"pk": 73, "model": "contenttypes.contenttype", "fields": {"model": "optout", "name": "optout", "app_label": "bulk_email"}}, {"pk": 107, "model": "contenttypes.contenttype", "fields": {"model": "order", "name": "order", "app_label": "shoppingcart"}}, {"pk": 108, "model": "contenttypes.contenttype", "fields": {"model": "orderitem", "name": "order item", "app_label": "shoppingcart"}}, {"pk": 118, "model": "contenttypes.contenttype", "fields": {"model": "paidcourseregistration", "name": "paid course registration", "app_label": "shoppingcart"}}, {"pk": 121, "model": "contenttypes.contenttype", "fields": {"model": "paidcourseregistrationannotation", "name": "paid course registration annotation", "app_label": "shoppingcart"}}, {"pk": 43, "model": "contenttypes.contenttype", "fields": {"model": "passwordhistory", "name": "password history", "app_label": "student"}}, {"pk": 158, "model": "contenttypes.contenttype", "fields": {"model": "peerworkflow", "name": "peer workflow", "app_label": "assessment"}}, {"pk": 159, "model": "contenttypes.contenttype", "fields": {"model": "peerworkflowitem", "name": "peer workflow item", "app_label": "assessment"}}, {"pk": 42, "model": "contenttypes.contenttype", "fields": {"model": "pendingemailchange", "name": "pending email change", "app_label": "student"}}, {"pk": 41, "model": "contenttypes.contenttype", "fields": {"model": "pendingnamechange", "name": "pending name change", "app_label": "student"}}, {"pk": 12, "model": "contenttypes.contenttype", "fields": {"model": "periodictask", "name": "periodic task", "app_label": "djcelery"}}, {"pk": 11, "model": "contenttypes.contenttype", "fields": {"model": "periodictasks", "name": "periodic tasks", "app_label": "djcelery"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 170, "model": "contenttypes.contenttype", "fields": {"model": "profile", "name": "profile", "app_label": "edxval"}}, {"pk": 17, "model": "contenttypes.contenttype", "fields": {"model": "psychometricdata", "name": "psychometric data", "app_label": "psychometrics"}}, {"pk": 188, "model": "contenttypes.contenttype", "fields": {"model": "pushnotificationconfig", "name": "push notification config", "app_label": "contentstore"}}, {"pk": 99, "model": "contenttypes.contenttype", "fields": {"model": "puzzlecomplete", "name": "puzzle complete", "app_label": "foldit"}}, {"pk": 55, "model": "contenttypes.contenttype", "fields": {"model": "ratelimitconfiguration", "name": "rate limit configuration", "app_label": "util"}}, {"pk": 82, "model": "contenttypes.contenttype", "fields": {"model": "refreshtoken", "name": "refresh token", "app_label": "oauth2"}}, {"pk": 40, "model": "contenttypes.contenttype", "fields": {"model": "registration", "name": "registration", "app_label": "student"}}, {"pk": 115, "model": "contenttypes.contenttype", "fields": {"model": "registrationcoderedemption", "name": "registration code redemption", "app_label": "shoppingcart"}}, {"pk": 135, "model": "contenttypes.contenttype", "fields": {"model": "restrictedcourse", "name": "restricted course", "app_label": "embargo"}}, {"pk": 89, "model": "contenttypes.contenttype", "fields": {"model": "reusableplugin", "name": "reusable plugin", "app_label": "wiki"}}, {"pk": 91, "model": "contenttypes.contenttype", "fields": {"model": "revisionplugin", "name": "revision plugin", "app_label": "wiki"}}, {"pk": 92, "model": "contenttypes.contenttype", "fields": {"model": "revisionpluginrevision", "name": "revision plugin revision", "app_label": "wiki"}}, {"pk": 151, "model": "contenttypes.contenttype", "fields": {"model": "rubric", "name": "rubric", "app_label": "assessment"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "tasksetmeta", "name": "saved group result", "app_label": "djcelery"}}, {"pk": 98, "model": "contenttypes.contenttype", "fields": {"model": "score", "name": "score", "app_label": "foldit"}}, {"pk": 149, "model": "contenttypes.contenttype", "fields": {"model": "score", "name": "score", "app_label": "submissions"}}, {"pk": 150, "model": "contenttypes.contenttype", "fields": {"model": "scoresummary", "name": "score summary", "app_label": "submissions"}}, {"pk": 16, "model": "contenttypes.contenttype", "fields": {"model": "servercircuit", "name": "server circuit", "app_label": "circuit"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 95, "model": "contenttypes.contenttype", "fields": {"model": "settings", "name": "settings", "app_label": "django_notify"}}, {"pk": 90, "model": "contenttypes.contenttype", "fields": {"model": "simpleplugin", "name": "simple plugin", "app_label": "wiki"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 131, "model": "contenttypes.contenttype", "fields": {"model": "skippedreverification", "name": "skipped reverification", "app_label": "verify_student"}}, {"pk": 127, "model": "contenttypes.contenttype", "fields": {"model": "softwaresecurephotoverification", "name": "software secure photo verification", "app_label": "verify_student"}}, {"pk": 101, "model": "contenttypes.contenttype", "fields": {"model": "splashconfig", "name": "splash config", "app_label": "splash"}}, {"pk": 34, "model": "contenttypes.contenttype", "fields": {"model": "studentfieldoverride", "name": "student field override", "app_label": "courseware"}}, {"pk": 147, "model": "contenttypes.contenttype", "fields": {"model": "studentitem", "name": "student item", "app_label": "submissions"}}, {"pk": 27, "model": "contenttypes.contenttype", "fields": {"model": "studentmodule", "name": "student module", "app_label": "courseware"}}, {"pk": 28, "model": "contenttypes.contenttype", "fields": {"model": "studentmodulehistory", "name": "student module history", "app_label": "courseware"}}, {"pk": 161, "model": "contenttypes.contenttype", "fields": {"model": "studenttrainingworkflow", "name": "student training workflow", "app_label": "assessment"}}, {"pk": 162, "model": "contenttypes.contenttype", "fields": {"model": "studenttrainingworkflowitem", "name": "student training workflow item", "app_label": "assessment"}}, {"pk": 190, "model": "contenttypes.contenttype", "fields": {"model": "studioconfig", "name": "studio config", "app_label": "xblock_config"}}, {"pk": 148, "model": "contenttypes.contenttype", "fields": {"model": "submission", "name": "submission", "app_label": "submissions"}}, {"pk": 96, "model": "contenttypes.contenttype", "fields": {"model": "subscription", "name": "subscription", "app_label": "django_notify"}}, {"pk": 174, "model": "contenttypes.contenttype", "fields": {"model": "subtitle", "name": "subtitle", "app_label": "edxval"}}, {"pk": 143, "model": "contenttypes.contenttype", "fields": {"model": "surveyanswer", "name": "survey answer", "app_label": "survey"}}, {"pk": 142, "model": "contenttypes.contenttype", "fields": {"model": "surveyform", "name": "survey form", "app_label": "survey"}}, {"pk": 14, "model": "contenttypes.contenttype", "fields": {"model": "taskstate", "name": "task", "app_label": "djcelery"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "taskmeta", "name": "task state", "app_label": "djcelery"}}, {"pk": 54, "model": "contenttypes.contenttype", "fields": {"model": "trackinglog", "name": "tracking log", "app_label": "track"}}, {"pk": 160, "model": "contenttypes.contenttype", "fields": {"model": "trainingexample", "name": "training example", "app_label": "assessment"}}, {"pk": 83, "model": "contenttypes.contenttype", "fields": {"model": "trustedclient", "name": "trusted client", "app_label": "oauth2_provider"}}, {"pk": 94, "model": "contenttypes.contenttype", "fields": {"model": "notificationtype", "name": "type", "app_label": "django_notify"}}, {"pk": 87, "model": "contenttypes.contenttype", "fields": {"model": "urlpath", "name": "URL path", "app_label": "wiki"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": 103, "model": "contenttypes.contenttype", "fields": {"model": "usercoursetag", "name": "user course tag", "app_label": "user_api"}}, {"pk": 67, "model": "contenttypes.contenttype", "fields": {"model": "userlicense", "name": "user license", "app_label": "licenses"}}, {"pk": 179, "model": "contenttypes.contenttype", "fields": {"model": "usermilestone", "name": "user milestone", "app_label": "milestones"}}, {"pk": 20, "model": "contenttypes.contenttype", "fields": {"model": "useropenid", "name": "user open id", "app_label": "django_openid_auth"}}, {"pk": 104, "model": "contenttypes.contenttype", "fields": {"model": "userorgtag", "name": "user org tag", "app_label": "user_api"}}, {"pk": 102, "model": "contenttypes.contenttype", "fields": {"model": "userpreference", "name": "user preference", "app_label": "user_api"}}, {"pk": 37, "model": "contenttypes.contenttype", "fields": {"model": "userprofile", "name": "user profile", "app_label": "student"}}, {"pk": 38, "model": "contenttypes.contenttype", "fields": {"model": "usersignupsource", "name": "user signup source", "app_label": "student"}}, {"pk": 23, "model": "contenttypes.contenttype", "fields": {"model": "usersocialauth", "name": "user social auth", "app_label": "default"}}, {"pk": 36, "model": "contenttypes.contenttype", "fields": {"model": "userstanding", "name": "user standing", "app_label": "student"}}, {"pk": 39, "model": "contenttypes.contenttype", "fields": {"model": "usertestgroup", "name": "user test group", "app_label": "student"}}, {"pk": 128, "model": "contenttypes.contenttype", "fields": {"model": "verificationcheckpoint", "name": "verification checkpoint", "app_label": "verify_student"}}, {"pk": 129, "model": "contenttypes.contenttype", "fields": {"model": "verificationstatus", "name": "Verification Status", "app_label": "verify_student"}}, {"pk": 171, "model": "contenttypes.contenttype", "fields": {"model": "video", "name": "video", "app_label": "edxval"}}, {"pk": 187, "model": "contenttypes.contenttype", "fields": {"model": "videouploadconfig", "name": "video upload config", "app_label": "contentstore"}}, {"pk": 13, "model": "contenttypes.contenttype", "fields": {"model": "workerstate", "name": "worker", "app_label": "djcelery"}}, {"pk": 144, "model": "contenttypes.contenttype", "fields": {"model": "xblockasidesconfig", "name": "x block asides config", "app_label": "lms_xblock"}}, {"pk": 146, "model": "contenttypes.contenttype", "fields": {"model": "xdomainproxyconfiguration", "name": "x domain proxy configuration", "app_label": "cors_csrf"}}, {"pk": 31, "model": "contenttypes.contenttype", "fields": {"model": "xmodulestudentinfofield", "name": "x module student info field", "app_label": "courseware"}}, {"pk": 30, "model": "contenttypes.contenttype", "fields": {"model": "xmodulestudentprefsfield", "name": "x module student prefs field", "app_label": "courseware"}}, {"pk": 29, "model": "contenttypes.contenttype", "fields": {"model": "xmoduleuserstatesummaryfield", "name": "x module user state summary field", "app_label": "courseware"}}, {"pk": 1, "model": "sites.site", "fields": {"domain": "example.com", "name": "example.com"}}, {"pk": 1, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:50Z", "app_name": "courseware", "migration": "0001_initial"}}, {"pk": 2, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0002_add_indexes"}}, {"pk": 3, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0003_done_grade_cache"}}, {"pk": 4, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0004_add_field_studentmodule_course_id"}}, {"pk": 5, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c"}}, {"pk": 6, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0006_create_student_module_history"}}, {"pk": 7, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:51Z", "app_name": "courseware", "migration": "0007_allow_null_version_in_history"}}, {"pk": 8, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0008_add_xmodule_storage"}}, {"pk": 9, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0009_add_field_default"}}, {"pk": 10, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0010_rename_xblock_field_content_to_user_state_summary"}}, {"pk": 11, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0011_add_model_StudentFieldOverride"}}, {"pk": 12, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0012_auto__del_unique_studentfieldoverride_course_id_location_student__add_"}}, {"pk": 13, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:52Z", "app_name": "courseware", "migration": "0013_auto__add_field_studentfieldoverride_created__add_field_studentfieldov"}}, {"pk": 14, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0001_initial"}}, {"pk": 15, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0002_text_to_varchar_and_indexes"}}, {"pk": 16, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0003_auto__add_usertestgroup"}}, {"pk": 17, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0004_add_email_index"}}, {"pk": 18, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0005_name_change"}}, {"pk": 19, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0006_expand_meta_field"}}, {"pk": 20, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0007_convert_to_utf8"}}, {"pk": 21, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0008__auto__add_courseregistration"}}, {"pk": 22, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:53Z", "app_name": "student", "migration": "0009_auto__del_courseregistration__add_courseenrollment"}}, {"pk": 23, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0010_auto__chg_field_courseenrollment_course_id"}}, {"pk": 24, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use"}}, {"pk": 25, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0012_auto__add_field_userprofile_gender__add_field_userprofile_date_of_birt"}}, {"pk": 26, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0013_auto__chg_field_userprofile_meta"}}, {"pk": 27, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0014_auto__del_courseenrollment"}}, {"pk": 28, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0015_auto__add_courseenrollment__add_unique_courseenrollment_user_course_id"}}, {"pk": 29, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country"}}, {"pk": 30, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0017_rename_date_to_created"}}, {"pk": 31, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0018_auto"}}, {"pk": 32, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:54Z", "app_name": "student", "migration": "0019_create_approved_demographic_fields_fall_2012"}}, {"pk": 33, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:55Z", "app_name": "student", "migration": "0020_add_test_center_user"}}, {"pk": 34, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:55Z", "app_name": "student", "migration": "0021_remove_askbot"}}, {"pk": 35, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:55Z", "app_name": "student", "migration": "0022_auto__add_courseenrollmentallowed__add_unique_courseenrollmentallowed_"}}, {"pk": 36, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0023_add_test_center_registration"}}, {"pk": 37, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0024_add_allow_certificate"}}, {"pk": 38, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0025_auto__add_field_courseenrollmentallowed_auto_enroll"}}, {"pk": 39, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0026_auto__remove_index_student_testcenterregistration_accommodation_request"}}, {"pk": 40, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0027_add_active_flag_and_mode_to_courseware_enrollment"}}, {"pk": 41, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0028_auto__add_userstanding"}}, {"pk": 42, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0029_add_lookup_table_between_user_and_anonymous_student_id"}}, {"pk": 43, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0029_remove_pearson"}}, {"pk": 44, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0030_auto__chg_field_anonymoususerid_anonymous_user_id"}}, {"pk": 45, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0031_drop_student_anonymoususerid_temp_archive"}}, {"pk": 46, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0032_add_field_UserProfile_country_add_field_UserProfile_city"}}, {"pk": 47, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:56Z", "app_name": "student", "migration": "0032_auto__add_loginfailures"}}, {"pk": 48, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:57Z", "app_name": "student", "migration": "0033_auto__add_passwordhistory"}}, {"pk": 49, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:57Z", "app_name": "student", "migration": "0034_auto__add_courseaccessrole"}}, {"pk": 50, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:58Z", "app_name": "student", "migration": "0035_access_roles"}}, {"pk": 51, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:58Z", "app_name": "student", "migration": "0036_access_roles_orgless"}}, {"pk": 52, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0037_auto__add_courseregistrationcode"}}, {"pk": 53, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0038_auto__add_usersignupsource"}}, {"pk": 54, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0039_auto__del_courseregistrationcode"}}, {"pk": 55, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u"}}, {"pk": 56, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0041_add_dashboard_config"}}, {"pk": 57, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0042_grant_sales_admin_roles"}}, {"pk": 58, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0043_auto__add_linkedinaddtoprofileconfiguration"}}, {"pk": 59, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0044_linkedin_add_company_identifier"}}, {"pk": 60, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0045_add_trk_partner_to_linkedin_config"}}, {"pk": 61, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:55:59Z", "app_name": "student", "migration": "0046_auto__add_entranceexamconfiguration__add_unique_entranceexamconfigurat"}}, {"pk": 62, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "student", "migration": "0047_add_bio_field"}}, {"pk": 63, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "student", "migration": "0048_add_profile_image_version"}}, {"pk": 64, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "student", "migration": "0049_auto__add_languageproficiency__add_unique_languageproficiency_code_use"}}, {"pk": 65, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "student", "migration": "0050_auto__add_manualenrollmentaudit"}}, {"pk": 66, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "student", "migration": "0051_auto__add_courseenrollmentattribute"}}, {"pk": 67, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:00Z", "app_name": "track", "migration": "0001_initial"}}, {"pk": 68, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:01Z", "app_name": "track", "migration": "0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch"}}, {"pk": 69, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:01Z", "app_name": "util", "migration": "0001_initial"}}, {"pk": 70, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:01Z", "app_name": "util", "migration": "0002_default_rate_limit_config"}}, {"pk": 71, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:01Z", "app_name": "certificates", "migration": "0001_added_generatedcertificates"}}, {"pk": 72, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:01Z", "app_name": "certificates", "migration": "0002_auto__add_field_generatedcertificate_download_url"}}, {"pk": 73, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0003_auto__add_field_generatedcertificate_enabled"}}, {"pk": 74, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_"}}, {"pk": 75, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0005_auto__add_field_generatedcertificate_name"}}, {"pk": 76, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0006_auto__chg_field_generatedcertificate_certificate_id"}}, {"pk": 77, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0007_auto__add_revokedcertificate"}}, {"pk": 78, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add"}}, {"pk": 79, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge"}}, {"pk": 80, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti"}}, {"pk": 81, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:02Z", "app_name": "certificates", "migration": "0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat"}}, {"pk": 82, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0012_auto__add_field_generatedcertificate_name__add_field_generatedcertific"}}, {"pk": 83, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0013_auto__add_field_generatedcertificate_error_reason"}}, {"pk": 84, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0014_adding_whitelist"}}, {"pk": 85, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0015_adding_mode_for_verified_certs"}}, {"pk": 86, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0016_change_course_key_fields"}}, {"pk": 87, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0017_auto__add_certificategenerationconfiguration"}}, {"pk": 88, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0018_add_example_cert_models"}}, {"pk": 89, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0019_auto__add_certificatehtmlviewconfiguration"}}, {"pk": 90, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:03Z", "app_name": "certificates", "migration": "0020_certificatehtmlviewconfiguration_data"}}, {"pk": 91, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:04Z", "app_name": "certificates", "migration": "0021_auto__add_badgeassertion__add_unique_badgeassertion_course_id_user__ad"}}, {"pk": 92, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:04Z", "app_name": "certificates", "migration": "0022_default_modes"}}, {"pk": 93, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:04Z", "app_name": "instructor_task", "migration": "0001_initial"}}, {"pk": 94, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:04Z", "app_name": "instructor_task", "migration": "0002_add_subtask_field"}}, {"pk": 95, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:05Z", "app_name": "licenses", "migration": "0001_initial"}}, {"pk": 96, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:05Z", "app_name": "course_groups", "migration": "0001_initial"}}, {"pk": 97, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:05Z", "app_name": "course_groups", "migration": "0002_add_model_CourseUserGroupPartitionGroup"}}, {"pk": 98, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "course_groups", "migration": "0003_auto__add_coursecohort__add_coursecohortssettings"}}, {"pk": 99, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "course_groups", "migration": "0004_auto__del_field_coursecohortssettings_cohorted_discussions__add_field_"}}, {"pk": 100, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0001_initial"}}, {"pk": 101, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0002_change_field_names"}}, {"pk": 102, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0003_add_optout_user"}}, {"pk": 103, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0004_migrate_optout_user"}}, {"pk": 104, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0005_remove_optout_email"}}, {"pk": 105, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:06Z", "app_name": "bulk_email", "migration": "0006_add_course_email_template"}}, {"pk": 106, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "bulk_email", "migration": "0007_load_course_email_template"}}, {"pk": 107, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "bulk_email", "migration": "0008_add_course_authorizations"}}, {"pk": 108, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "bulk_email", "migration": "0009_force_unique_course_ids"}}, {"pk": 109, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "bulk_email", "migration": "0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_"}}, {"pk": 110, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "branding", "migration": "0001_initial"}}, {"pk": 111, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:07Z", "app_name": "branding", "migration": "0002_auto__add_brandingapiconfig"}}, {"pk": 112, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:08Z", "app_name": "external_auth", "migration": "0001_initial"}}, {"pk": 113, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:09Z", "app_name": "oauth2", "migration": "0001_initial"}}, {"pk": 114, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:09Z", "app_name": "oauth2", "migration": "0002_auto__chg_field_client_user"}}, {"pk": 115, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:09Z", "app_name": "oauth2", "migration": "0003_auto__add_field_client_name"}}, {"pk": 116, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:09Z", "app_name": "oauth2", "migration": "0004_auto__add_index_accesstoken_token"}}, {"pk": 117, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:09Z", "app_name": "oauth2_provider", "migration": "0001_initial"}}, {"pk": 118, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:10Z", "app_name": "wiki", "migration": "0001_initial"}}, {"pk": 119, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:10Z", "app_name": "wiki", "migration": "0002_auto__add_field_articleplugin_created"}}, {"pk": 120, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0003_auto__add_field_urlpath_article"}}, {"pk": 121, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0004_populate_urlpath__article"}}, {"pk": 122, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0005_auto__chg_field_urlpath_article"}}, {"pk": 123, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0006_auto__add_attachmentrevision__add_image__add_attachment"}}, {"pk": 124, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0007_auto__add_articlesubscription"}}, {"pk": 125, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0008_auto__add_simpleplugin__add_revisionpluginrevision__add_imagerevision_"}}, {"pk": 126, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0009_auto__add_field_imagerevision_width__add_field_imagerevision_height"}}, {"pk": 127, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:11Z", "app_name": "wiki", "migration": "0010_auto__chg_field_imagerevision_image"}}, {"pk": 128, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:12Z", "app_name": "wiki", "migration": "0011_auto__chg_field_imagerevision_width__chg_field_imagerevision_height"}}, {"pk": 129, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:12Z", "app_name": "django_notify", "migration": "0001_initial"}}, {"pk": 130, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:13Z", "app_name": "notifications", "migration": "0001_initial"}}, {"pk": 131, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:13Z", "app_name": "foldit", "migration": "0001_initial"}}, {"pk": 132, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:14Z", "app_name": "django_comment_client", "migration": "0001_initial"}}, {"pk": 133, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:14Z", "app_name": "django_comment_common", "migration": "0001_initial"}}, {"pk": 134, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:15Z", "app_name": "notes", "migration": "0001_initial"}}, {"pk": 135, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:15Z", "app_name": "splash", "migration": "0001_initial"}}, {"pk": 136, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:15Z", "app_name": "splash", "migration": "0002_auto__add_field_splashconfig_unaffected_url_paths"}}, {"pk": 137, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:15Z", "app_name": "user_api", "migration": "0001_initial"}}, {"pk": 138, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:16Z", "app_name": "user_api", "migration": "0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key"}}, {"pk": 139, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:16Z", "app_name": "user_api", "migration": "0003_rename_usercoursetags"}}, {"pk": 140, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:16Z", "app_name": "user_api", "migration": "0004_auto__add_userorgtag__add_unique_userorgtag_user_org_key__chg_field_us"}}, {"pk": 141, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:16Z", "app_name": "teams", "migration": "0001_initial"}}, {"pk": 142, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0001_initial"}}, {"pk": 143, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0002_auto__add_field_paidcourseregistration_mode"}}, {"pk": 144, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0003_auto__del_field_orderitem_line_cost"}}, {"pk": 145, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0004_auto__add_field_orderitem_fulfilled_time"}}, {"pk": 146, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report"}}, {"pk": 147, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:17Z", "app_name": "shoppingcart", "migration": "0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques"}}, {"pk": 148, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:18Z", "app_name": "shoppingcart", "migration": "0007_auto__add_field_orderitem_service_fee"}}, {"pk": 149, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:18Z", "app_name": "shoppingcart", "migration": "0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou"}}, {"pk": 150, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:18Z", "app_name": "shoppingcart", "migration": "0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c"}}, {"pk": 151, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:18Z", "app_name": "shoppingcart", "migration": "0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode"}}, {"pk": 152, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:19Z", "app_name": "shoppingcart", "migration": "0011_auto__add_invoice__add_field_courseregistrationcode_invoice"}}, {"pk": 153, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:19Z", "app_name": "shoppingcart", "migration": "0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie"}}, {"pk": 154, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:19Z", "app_name": "shoppingcart", "migration": "0013_auto__add_field_invoice_is_valid"}}, {"pk": 155, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_"}}, {"pk": 156, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa"}}, {"pk": 157, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer"}}, {"pk": 158, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco"}}, {"pk": 159, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0018_auto__add_donation"}}, {"pk": 160, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:20Z", "app_name": "shoppingcart", "migration": "0019_auto__add_donationconfiguration"}}, {"pk": 161, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:21Z", "app_name": "shoppingcart", "migration": "0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel"}}, {"pk": 162, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:21Z", "app_name": "shoppingcart", "migration": "0021_auto__add_field_orderitem_created__add_field_orderitem_modified"}}, {"pk": 163, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:21Z", "app_name": "shoppingcart", "migration": "0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel"}}, {"pk": 164, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:21Z", "app_name": "shoppingcart", "migration": "0023_auto__add_field_coupon_expiration_date"}}, {"pk": 165, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:21Z", "app_name": "shoppingcart", "migration": "0024_auto__add_field_courseregistrationcode_mode_slug"}}, {"pk": 166, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:22Z", "app_name": "shoppingcart", "migration": "0025_update_invoice_models"}}, {"pk": 167, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:22Z", "app_name": "shoppingcart", "migration": "0026_migrate_invoices"}}, {"pk": 168, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:22Z", "app_name": "shoppingcart", "migration": "0027_add_invoice_history"}}, {"pk": 169, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:22Z", "app_name": "shoppingcart", "migration": "0028_auto__add_field_courseregistrationcode_is_valid"}}, {"pk": 170, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0001_initial"}}, {"pk": 171, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0002_auto__add_field_coursemode_currency"}}, {"pk": 172, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0003_auto__add_unique_coursemode_course_id_currency_mode_slug"}}, {"pk": 173, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0004_auto__add_field_coursemode_expiration_date"}}, {"pk": 174, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0005_auto__add_field_coursemode_expiration_datetime"}}, {"pk": 175, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0006_expiration_date_to_datetime"}}, {"pk": 176, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0007_add_description"}}, {"pk": 177, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id"}}, {"pk": 178, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "course_modes", "migration": "0008_auto__del_field_coursemodesarchive_description__add_field_coursemode_s"}}, {"pk": 179, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:23Z", "app_name": "verify_student", "migration": "0001_initial"}}, {"pk": 180, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0002_auto__add_field_softwaresecurephotoverification_window"}}, {"pk": 181, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0003_auto__add_field_softwaresecurephotoverification_display"}}, {"pk": 182, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0004_auto__add_verificationcheckpoint__add_unique_verificationcheckpoint_co"}}, {"pk": 183, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0005_auto__add_incoursereverificationconfiguration"}}, {"pk": 184, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0006_auto__add_skippedreverification__add_unique_skippedreverification_user"}}, {"pk": 185, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0007_auto__add_field_verificationstatus_location_id"}}, {"pk": 186, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0008_auto__del_field_verificationcheckpoint_checkpoint_name__add_field_veri"}}, {"pk": 187, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:24Z", "app_name": "verify_student", "migration": "0009_auto__change_softwaresecurephotoverification_window_id_default_none"}}, {"pk": 188, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:25Z", "app_name": "verify_student", "migration": "0010_auto__del_field_softwaresecurephotoverification_window"}}, {"pk": 189, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:25Z", "app_name": "dark_lang", "migration": "0001_initial"}}, {"pk": 190, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:25Z", "app_name": "dark_lang", "migration": "0002_enable_on_install"}}, {"pk": 191, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:25Z", "app_name": "reverification", "migration": "0001_initial"}}, {"pk": 192, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:25Z", "app_name": "reverification", "migration": "0002_auto__del_midcoursereverificationwindow"}}, {"pk": 193, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:26Z", "app_name": "embargo", "migration": "0001_initial"}}, {"pk": 194, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:26Z", "app_name": "embargo", "migration": "0002_add_country_access_models"}}, {"pk": 195, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:27Z", "app_name": "embargo", "migration": "0003_add_countries"}}, {"pk": 196, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:27Z", "app_name": "embargo", "migration": "0004_migrate_embargo_config"}}, {"pk": 197, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:27Z", "app_name": "embargo", "migration": "0005_add_courseaccessrulehistory"}}, {"pk": 198, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:27Z", "app_name": "embargo", "migration": "0006_auto__add_field_restrictedcourse_disable_access_check"}}, {"pk": 199, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:28Z", "app_name": "course_action_state", "migration": "0001_initial"}}, {"pk": 200, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:28Z", "app_name": "course_action_state", "migration": "0002_add_rerun_display_name"}}, {"pk": 201, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:28Z", "app_name": "mobile_api", "migration": "0001_initial"}}, {"pk": 202, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:29Z", "app_name": "survey", "migration": "0001_initial"}}, {"pk": 203, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:30Z", "app_name": "lms_xblock", "migration": "0001_initial"}}, {"pk": 204, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:30Z", "app_name": "course_structures", "migration": "0001_initial"}}, {"pk": 205, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:30Z", "app_name": "cors_csrf", "migration": "0001_initial"}}, {"pk": 206, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:31Z", "app_name": "submissions", "migration": "0001_initial"}}, {"pk": 207, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:31Z", "app_name": "submissions", "migration": "0002_auto__add_scoresummary"}}, {"pk": 208, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:31Z", "app_name": "submissions", "migration": "0003_auto__del_field_submission_answer__add_field_submission_raw_answer"}}, {"pk": 209, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:31Z", "app_name": "submissions", "migration": "0004_auto__add_field_score_reset"}}, {"pk": 210, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:32Z", "app_name": "assessment", "migration": "0001_initial"}}, {"pk": 211, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0002_auto__add_assessmentfeedbackoption__del_field_assessmentfeedback_feedb"}}, {"pk": 212, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0003_add_index_pw_course_item_student"}}, {"pk": 213, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0004_auto__add_field_peerworkflow_graded_count"}}, {"pk": 214, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0005_auto__del_field_peerworkflow_graded_count__add_field_peerworkflow_grad"}}, {"pk": 215, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0006_auto__add_field_assessmentpart_feedback"}}, {"pk": 216, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0007_auto__chg_field_assessmentpart_feedback"}}, {"pk": 217, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:33Z", "app_name": "assessment", "migration": "0008_student_training"}}, {"pk": 218, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:34Z", "app_name": "assessment", "migration": "0009_auto__add_unique_studenttrainingworkflowitem_order_num_workflow"}}, {"pk": 219, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:34Z", "app_name": "assessment", "migration": "0010_auto__add_unique_studenttrainingworkflow_submission_uuid"}}, {"pk": 220, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:34Z", "app_name": "assessment", "migration": "0011_ai_training"}}, {"pk": 221, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:34Z", "app_name": "assessment", "migration": "0012_move_algorithm_id_to_classifier_set"}}, {"pk": 222, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:34Z", "app_name": "assessment", "migration": "0013_auto__add_field_aigradingworkflow_essay_text"}}, {"pk": 223, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0014_auto__add_field_aitrainingworkflow_item_id__add_field_aitrainingworkfl"}}, {"pk": 224, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0015_auto__add_unique_aitrainingworkflow_uuid__add_unique_aigradingworkflow"}}, {"pk": 225, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0016_auto__add_field_aiclassifierset_course_id__add_field_aiclassifierset_i"}}, {"pk": 226, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0016_auto__add_field_rubric_structure_hash"}}, {"pk": 227, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0017_rubric_structure_hash"}}, {"pk": 228, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0018_auto__add_field_assessmentpart_criterion"}}, {"pk": 229, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0019_assessmentpart_criterion_field"}}, {"pk": 230, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0020_assessmentpart_criterion_not_null"}}, {"pk": 231, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:35Z", "app_name": "assessment", "migration": "0021_assessmentpart_option_nullable"}}, {"pk": 232, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "assessment", "migration": "0022__add_label_fields"}}, {"pk": 233, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "assessment", "migration": "0023_assign_criteria_and_option_labels"}}, {"pk": 234, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "assessment", "migration": "0024_auto__chg_field_assessmentpart_criterion"}}, {"pk": 235, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "assessment", "migration": "0025_auto__add_field_peerworkflow_cancelled_at"}}, {"pk": 236, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "workflow", "migration": "0001_initial"}}, {"pk": 237, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "workflow", "migration": "0002_auto__add_field_assessmentworkflow_course_id__add_field_assessmentwork"}}, {"pk": 238, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:36Z", "app_name": "workflow", "migration": "0003_auto__add_assessmentworkflowstep"}}, {"pk": 239, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:37Z", "app_name": "workflow", "migration": "0004_auto__add_assessmentworkflowcancellation"}}, {"pk": 240, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:37Z", "app_name": "edxval", "migration": "0001_initial"}}, {"pk": 241, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:37Z", "app_name": "edxval", "migration": "0002_default_profiles"}}, {"pk": 242, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:37Z", "app_name": "edxval", "migration": "0003_status_and_created_fields"}}, {"pk": 243, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:38Z", "app_name": "edxval", "migration": "0004_remove_profile_fields"}}, {"pk": 244, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:39Z", "app_name": "milestones", "migration": "0001_initial"}}, {"pk": 245, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:39Z", "app_name": "milestones", "migration": "0002_seed_relationship_types"}}, {"pk": 246, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:39Z", "app_name": "django_extensions", "migration": "0001_empty"}}, {"pk": 247, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:40Z", "app_name": "credit", "migration": "0001_initial"}}, {"pk": 248, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:40Z", "app_name": "credit", "migration": "0002_rename_credit_requirement_criteria_field"}}, {"pk": 249, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:40Z", "app_name": "credit", "migration": "0003_add_creditrequirementstatus_reason"}}, {"pk": 250, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:40Z", "app_name": "credit", "migration": "0004_auto__add_field_creditrequirement_display_name"}}, {"pk": 251, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:40Z", "app_name": "credit", "migration": "0005_auto__add_field_creditprovider_provider_url__add_field_creditprovider_"}}, {"pk": 252, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:41Z", "app_name": "credit", "migration": "0006_auto__add_creditrequest__add_unique_creditrequest_username_course_prov"}}, {"pk": 253, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:41Z", "app_name": "credit", "migration": "0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro"}}, {"pk": 254, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:45Z", "app_name": "contentstore", "migration": "0001_initial"}}, {"pk": 255, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:45Z", "app_name": "contentstore", "migration": "0002_auto__del_field_videouploadconfig_status_whitelist"}}, {"pk": 256, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:45Z", "app_name": "contentstore", "migration": "0003_auto__add_pushnotificationconfig"}}, {"pk": 257, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:46Z", "app_name": "course_creators", "migration": "0001_initial"}}, {"pk": 258, "model": "south.migrationhistory", "fields": {"applied": "2015-06-17T19:56:46Z", "app_name": "xblock_config", "migration": "0001_initial"}}, {"pk": 1, "model": "certificates.badgeimageconfiguration", "fields": {"default": false, "mode": "honor", "icon": "./honor.png"}}, {"pk": 2, "model": "certificates.badgeimageconfiguration", "fields": {"default": false, "mode": "verified", "icon": "./verified.png"}}, {"pk": 3, "model": "certificates.badgeimageconfiguration", "fields": {"default": false, "mode": "professional", "icon": "./professional.png"}}, {"pk": 6, "model": "embargo.country", "fields": {"country": "AD"}}, {"pk": 234, "model": "embargo.country", "fields": {"country": "AE"}}, {"pk": 1, "model": "embargo.country", "fields": {"country": "AF"}}, {"pk": 10, "model": "embargo.country", "fields": {"country": "AG"}}, {"pk": 8, "model": "embargo.country", "fields": {"country": "AI"}}, {"pk": 3, "model": "embargo.country", "fields": {"country": "AL"}}, {"pk": 12, "model": "embargo.country", "fields": {"country": "AM"}}, {"pk": 7, "model": "embargo.country", "fields": {"country": "AO"}}, {"pk": 9, "model": "embargo.country", "fields": {"country": "AQ"}}, {"pk": 11, "model": "embargo.country", "fields": {"country": "AR"}}, {"pk": 5, "model": "embargo.country", "fields": {"country": "AS"}}, {"pk": 15, "model": "embargo.country", "fields": {"country": "AT"}}, {"pk": 14, "model": "embargo.country", "fields": {"country": "AU"}}, {"pk": 13, "model": "embargo.country", "fields": {"country": "AW"}}, {"pk": 2, "model": "embargo.country", "fields": {"country": "AX"}}, {"pk": 16, "model": "embargo.country", "fields": {"country": "AZ"}}, {"pk": 29, "model": "embargo.country", "fields": {"country": "BA"}}, {"pk": 20, "model": "embargo.country", "fields": {"country": "BB"}}, {"pk": 19, "model": "embargo.country", "fields": {"country": "BD"}}, {"pk": 22, "model": "embargo.country", "fields": {"country": "BE"}}, {"pk": 36, "model": "embargo.country", "fields": {"country": "BF"}}, {"pk": 35, "model": "embargo.country", "fields": {"country": "BG"}}, {"pk": 18, "model": "embargo.country", "fields": {"country": "BH"}}, {"pk": 37, "model": "embargo.country", "fields": {"country": "BI"}}, {"pk": 24, "model": "embargo.country", "fields": {"country": "BJ"}}, {"pk": 184, "model": "embargo.country", "fields": {"country": "BL"}}, {"pk": 25, "model": "embargo.country", "fields": {"country": "BM"}}, {"pk": 34, "model": "embargo.country", "fields": {"country": "BN"}}, {"pk": 27, "model": "embargo.country", "fields": {"country": "BO"}}, {"pk": 28, "model": "embargo.country", "fields": {"country": "BQ"}}, {"pk": 32, "model": "embargo.country", "fields": {"country": "BR"}}, {"pk": 17, "model": "embargo.country", "fields": {"country": "BS"}}, {"pk": 26, "model": "embargo.country", "fields": {"country": "BT"}}, {"pk": 31, "model": "embargo.country", "fields": {"country": "BV"}}, {"pk": 30, "model": "embargo.country", "fields": {"country": "BW"}}, {"pk": 21, "model": "embargo.country", "fields": {"country": "BY"}}, {"pk": 23, "model": "embargo.country", "fields": {"country": "BZ"}}, {"pk": 41, "model": "embargo.country", "fields": {"country": "CA"}}, {"pk": 48, "model": "embargo.country", "fields": {"country": "CC"}}, {"pk": 52, "model": "embargo.country", "fields": {"country": "CD"}}, {"pk": 43, "model": "embargo.country", "fields": {"country": "CF"}}, {"pk": 51, "model": "embargo.country", "fields": {"country": "CG"}}, {"pk": 216, "model": "embargo.country", "fields": {"country": "CH"}}, {"pk": 55, "model": "embargo.country", "fields": {"country": "CI"}}, {"pk": 53, "model": "embargo.country", "fields": {"country": "CK"}}, {"pk": 45, "model": "embargo.country", "fields": {"country": "CL"}}, {"pk": 40, "model": "embargo.country", "fields": {"country": "CM"}}, {"pk": 46, "model": "embargo.country", "fields": {"country": "CN"}}, {"pk": 49, "model": "embargo.country", "fields": {"country": "CO"}}, {"pk": 54, "model": "embargo.country", "fields": {"country": "CR"}}, {"pk": 57, "model": "embargo.country", "fields": {"country": "CU"}}, {"pk": 38, "model": "embargo.country", "fields": {"country": "CV"}}, {"pk": 58, "model": "embargo.country", "fields": {"country": "CW"}}, {"pk": 47, "model": "embargo.country", "fields": {"country": "CX"}}, {"pk": 59, "model": "embargo.country", "fields": {"country": "CY"}}, {"pk": 60, "model": "embargo.country", "fields": {"country": "CZ"}}, {"pk": 83, "model": "embargo.country", "fields": {"country": "DE"}}, {"pk": 62, "model": "embargo.country", "fields": {"country": "DJ"}}, {"pk": 61, "model": "embargo.country", "fields": {"country": "DK"}}, {"pk": 63, "model": "embargo.country", "fields": {"country": "DM"}}, {"pk": 64, "model": "embargo.country", "fields": {"country": "DO"}}, {"pk": 4, "model": "embargo.country", "fields": {"country": "DZ"}}, {"pk": 65, "model": "embargo.country", "fields": {"country": "EC"}}, {"pk": 70, "model": "embargo.country", "fields": {"country": "EE"}}, {"pk": 66, "model": "embargo.country", "fields": {"country": "EG"}}, {"pk": 246, "model": "embargo.country", "fields": {"country": "EH"}}, {"pk": 69, "model": "embargo.country", "fields": {"country": "ER"}}, {"pk": 209, "model": "embargo.country", "fields": {"country": "ES"}}, {"pk": 71, "model": "embargo.country", "fields": {"country": "ET"}}, {"pk": 75, "model": "embargo.country", "fields": {"country": "FI"}}, {"pk": 74, "model": "embargo.country", "fields": {"country": "FJ"}}, {"pk": 72, "model": "embargo.country", "fields": {"country": "FK"}}, {"pk": 143, "model": "embargo.country", "fields": {"country": "FM"}}, {"pk": 73, "model": "embargo.country", "fields": {"country": "FO"}}, {"pk": 76, "model": "embargo.country", "fields": {"country": "FR"}}, {"pk": 80, "model": "embargo.country", "fields": {"country": "GA"}}, {"pk": 235, "model": "embargo.country", "fields": {"country": "GB"}}, {"pk": 88, "model": "embargo.country", "fields": {"country": "GD"}}, {"pk": 82, "model": "embargo.country", "fields": {"country": "GE"}}, {"pk": 77, "model": "embargo.country", "fields": {"country": "GF"}}, {"pk": 92, "model": "embargo.country", "fields": {"country": "GG"}}, {"pk": 84, "model": "embargo.country", "fields": {"country": "GH"}}, {"pk": 85, "model": "embargo.country", "fields": {"country": "GI"}}, {"pk": 87, "model": "embargo.country", "fields": {"country": "GL"}}, {"pk": 81, "model": "embargo.country", "fields": {"country": "GM"}}, {"pk": 93, "model": "embargo.country", "fields": {"country": "GN"}}, {"pk": 89, "model": "embargo.country", "fields": {"country": "GP"}}, {"pk": 68, "model": "embargo.country", "fields": {"country": "GQ"}}, {"pk": 86, "model": "embargo.country", "fields": {"country": "GR"}}, {"pk": 206, "model": "embargo.country", "fields": {"country": "GS"}}, {"pk": 91, "model": "embargo.country", "fields": {"country": "GT"}}, {"pk": 90, "model": "embargo.country", "fields": {"country": "GU"}}, {"pk": 94, "model": "embargo.country", "fields": {"country": "GW"}}, {"pk": 95, "model": "embargo.country", "fields": {"country": "GY"}}, {"pk": 100, "model": "embargo.country", "fields": {"country": "HK"}}, {"pk": 97, "model": "embargo.country", "fields": {"country": "HM"}}, {"pk": 99, "model": "embargo.country", "fields": {"country": "HN"}}, {"pk": 56, "model": "embargo.country", "fields": {"country": "HR"}}, {"pk": 96, "model": "embargo.country", "fields": {"country": "HT"}}, {"pk": 101, "model": "embargo.country", "fields": {"country": "HU"}}, {"pk": 104, "model": "embargo.country", "fields": {"country": "ID"}}, {"pk": 107, "model": "embargo.country", "fields": {"country": "IE"}}, {"pk": 109, "model": "embargo.country", "fields": {"country": "IL"}}, {"pk": 108, "model": "embargo.country", "fields": {"country": "IM"}}, {"pk": 103, "model": "embargo.country", "fields": {"country": "IN"}}, {"pk": 33, "model": "embargo.country", "fields": {"country": "IO"}}, {"pk": 106, "model": "embargo.country", "fields": {"country": "IQ"}}, {"pk": 105, "model": "embargo.country", "fields": {"country": "IR"}}, {"pk": 102, "model": "embargo.country", "fields": {"country": "IS"}}, {"pk": 110, "model": "embargo.country", "fields": {"country": "IT"}}, {"pk": 113, "model": "embargo.country", "fields": {"country": "JE"}}, {"pk": 111, "model": "embargo.country", "fields": {"country": "JM"}}, {"pk": 114, "model": "embargo.country", "fields": {"country": "JO"}}, {"pk": 112, "model": "embargo.country", "fields": {"country": "JP"}}, {"pk": 116, "model": "embargo.country", "fields": {"country": "KE"}}, {"pk": 119, "model": "embargo.country", "fields": {"country": "KG"}}, {"pk": 39, "model": "embargo.country", "fields": {"country": "KH"}}, {"pk": 117, "model": "embargo.country", "fields": {"country": "KI"}}, {"pk": 50, "model": "embargo.country", "fields": {"country": "KM"}}, {"pk": 186, "model": "embargo.country", "fields": {"country": "KN"}}, {"pk": 163, "model": "embargo.country", "fields": {"country": "KP"}}, {"pk": 207, "model": "embargo.country", "fields": {"country": "KR"}}, {"pk": 118, "model": "embargo.country", "fields": {"country": "KW"}}, {"pk": 42, "model": "embargo.country", "fields": {"country": "KY"}}, {"pk": 115, "model": "embargo.country", "fields": {"country": "KZ"}}, {"pk": 120, "model": "embargo.country", "fields": {"country": "LA"}}, {"pk": 122, "model": "embargo.country", "fields": {"country": "LB"}}, {"pk": 187, "model": "embargo.country", "fields": {"country": "LC"}}, {"pk": 126, "model": "embargo.country", "fields": {"country": "LI"}}, {"pk": 210, "model": "embargo.country", "fields": {"country": "LK"}}, {"pk": 124, "model": "embargo.country", "fields": {"country": "LR"}}, {"pk": 123, "model": "embargo.country", "fields": {"country": "LS"}}, {"pk": 127, "model": "embargo.country", "fields": {"country": "LT"}}, {"pk": 128, "model": "embargo.country", "fields": {"country": "LU"}}, {"pk": 121, "model": "embargo.country", "fields": {"country": "LV"}}, {"pk": 125, "model": "embargo.country", "fields": {"country": "LY"}}, {"pk": 149, "model": "embargo.country", "fields": {"country": "MA"}}, {"pk": 145, "model": "embargo.country", "fields": {"country": "MC"}}, {"pk": 144, "model": "embargo.country", "fields": {"country": "MD"}}, {"pk": 147, "model": "embargo.country", "fields": {"country": "ME"}}, {"pk": 188, "model": "embargo.country", "fields": {"country": "MF"}}, {"pk": 131, "model": "embargo.country", "fields": {"country": "MG"}}, {"pk": 137, "model": "embargo.country", "fields": {"country": "MH"}}, {"pk": 130, "model": "embargo.country", "fields": {"country": "MK"}}, {"pk": 135, "model": "embargo.country", "fields": {"country": "ML"}}, {"pk": 151, "model": "embargo.country", "fields": {"country": "MM"}}, {"pk": 146, "model": "embargo.country", "fields": {"country": "MN"}}, {"pk": 129, "model": "embargo.country", "fields": {"country": "MO"}}, {"pk": 164, "model": "embargo.country", "fields": {"country": "MP"}}, {"pk": 138, "model": "embargo.country", "fields": {"country": "MQ"}}, {"pk": 139, "model": "embargo.country", "fields": {"country": "MR"}}, {"pk": 148, "model": "embargo.country", "fields": {"country": "MS"}}, {"pk": 136, "model": "embargo.country", "fields": {"country": "MT"}}, {"pk": 140, "model": "embargo.country", "fields": {"country": "MU"}}, {"pk": 134, "model": "embargo.country", "fields": {"country": "MV"}}, {"pk": 132, "model": "embargo.country", "fields": {"country": "MW"}}, {"pk": 142, "model": "embargo.country", "fields": {"country": "MX"}}, {"pk": 133, "model": "embargo.country", "fields": {"country": "MY"}}, {"pk": 150, "model": "embargo.country", "fields": {"country": "MZ"}}, {"pk": 152, "model": "embargo.country", "fields": {"country": "NA"}}, {"pk": 156, "model": "embargo.country", "fields": {"country": "NC"}}, {"pk": 159, "model": "embargo.country", "fields": {"country": "NE"}}, {"pk": 162, "model": "embargo.country", "fields": {"country": "NF"}}, {"pk": 160, "model": "embargo.country", "fields": {"country": "NG"}}, {"pk": 158, "model": "embargo.country", "fields": {"country": "NI"}}, {"pk": 155, "model": "embargo.country", "fields": {"country": "NL"}}, {"pk": 165, "model": "embargo.country", "fields": {"country": "NO"}}, {"pk": 154, "model": "embargo.country", "fields": {"country": "NP"}}, {"pk": 153, "model": "embargo.country", "fields": {"country": "NR"}}, {"pk": 161, "model": "embargo.country", "fields": {"country": "NU"}}, {"pk": 157, "model": "embargo.country", "fields": {"country": "NZ"}}, {"pk": 166, "model": "embargo.country", "fields": {"country": "OM"}}, {"pk": 170, "model": "embargo.country", "fields": {"country": "PA"}}, {"pk": 173, "model": "embargo.country", "fields": {"country": "PE"}}, {"pk": 78, "model": "embargo.country", "fields": {"country": "PF"}}, {"pk": 171, "model": "embargo.country", "fields": {"country": "PG"}}, {"pk": 174, "model": "embargo.country", "fields": {"country": "PH"}}, {"pk": 167, "model": "embargo.country", "fields": {"country": "PK"}}, {"pk": 176, "model": "embargo.country", "fields": {"country": "PL"}}, {"pk": 189, "model": "embargo.country", "fields": {"country": "PM"}}, {"pk": 175, "model": "embargo.country", "fields": {"country": "PN"}}, {"pk": 178, "model": "embargo.country", "fields": {"country": "PR"}}, {"pk": 169, "model": "embargo.country", "fields": {"country": "PS"}}, {"pk": 177, "model": "embargo.country", "fields": {"country": "PT"}}, {"pk": 168, "model": "embargo.country", "fields": {"country": "PW"}}, {"pk": 172, "model": "embargo.country", "fields": {"country": "PY"}}, {"pk": 179, "model": "embargo.country", "fields": {"country": "QA"}}, {"pk": 180, "model": "embargo.country", "fields": {"country": "RE"}}, {"pk": 181, "model": "embargo.country", "fields": {"country": "RO"}}, {"pk": 196, "model": "embargo.country", "fields": {"country": "RS"}}, {"pk": 182, "model": "embargo.country", "fields": {"country": "RU"}}, {"pk": 183, "model": "embargo.country", "fields": {"country": "RW"}}, {"pk": 194, "model": "embargo.country", "fields": {"country": "SA"}}, {"pk": 203, "model": "embargo.country", "fields": {"country": "SB"}}, {"pk": 197, "model": "embargo.country", "fields": {"country": "SC"}}, {"pk": 211, "model": "embargo.country", "fields": {"country": "SD"}}, {"pk": 215, "model": "embargo.country", "fields": {"country": "SE"}}, {"pk": 199, "model": "embargo.country", "fields": {"country": "SG"}}, {"pk": 185, "model": "embargo.country", "fields": {"country": "SH"}}, {"pk": 202, "model": "embargo.country", "fields": {"country": "SI"}}, {"pk": 213, "model": "embargo.country", "fields": {"country": "SJ"}}, {"pk": 201, "model": "embargo.country", "fields": {"country": "SK"}}, {"pk": 198, "model": "embargo.country", "fields": {"country": "SL"}}, {"pk": 192, "model": "embargo.country", "fields": {"country": "SM"}}, {"pk": 195, "model": "embargo.country", "fields": {"country": "SN"}}, {"pk": 204, "model": "embargo.country", "fields": {"country": "SO"}}, {"pk": 212, "model": "embargo.country", "fields": {"country": "SR"}}, {"pk": 208, "model": "embargo.country", "fields": {"country": "SS"}}, {"pk": 193, "model": "embargo.country", "fields": {"country": "ST"}}, {"pk": 67, "model": "embargo.country", "fields": {"country": "SV"}}, {"pk": 200, "model": "embargo.country", "fields": {"country": "SX"}}, {"pk": 217, "model": "embargo.country", "fields": {"country": "SY"}}, {"pk": 214, "model": "embargo.country", "fields": {"country": "SZ"}}, {"pk": 230, "model": "embargo.country", "fields": {"country": "TC"}}, {"pk": 44, "model": "embargo.country", "fields": {"country": "TD"}}, {"pk": 79, "model": "embargo.country", "fields": {"country": "TF"}}, {"pk": 223, "model": "embargo.country", "fields": {"country": "TG"}}, {"pk": 221, "model": "embargo.country", "fields": {"country": "TH"}}, {"pk": 219, "model": "embargo.country", "fields": {"country": "TJ"}}, {"pk": 224, "model": "embargo.country", "fields": {"country": "TK"}}, {"pk": 222, "model": "embargo.country", "fields": {"country": "TL"}}, {"pk": 229, "model": "embargo.country", "fields": {"country": "TM"}}, {"pk": 227, "model": "embargo.country", "fields": {"country": "TN"}}, {"pk": 225, "model": "embargo.country", "fields": {"country": "TO"}}, {"pk": 228, "model": "embargo.country", "fields": {"country": "TR"}}, {"pk": 226, "model": "embargo.country", "fields": {"country": "TT"}}, {"pk": 231, "model": "embargo.country", "fields": {"country": "TV"}}, {"pk": 218, "model": "embargo.country", "fields": {"country": "TW"}}, {"pk": 220, "model": "embargo.country", "fields": {"country": "TZ"}}, {"pk": 233, "model": "embargo.country", "fields": {"country": "UA"}}, {"pk": 232, "model": "embargo.country", "fields": {"country": "UG"}}, {"pk": 236, "model": "embargo.country", "fields": {"country": "UM"}}, {"pk": 237, "model": "embargo.country", "fields": {"country": "US"}}, {"pk": 238, "model": "embargo.country", "fields": {"country": "UY"}}, {"pk": 239, "model": "embargo.country", "fields": {"country": "UZ"}}, {"pk": 98, "model": "embargo.country", "fields": {"country": "VA"}}, {"pk": 190, "model": "embargo.country", "fields": {"country": "VC"}}, {"pk": 241, "model": "embargo.country", "fields": {"country": "VE"}}, {"pk": 243, "model": "embargo.country", "fields": {"country": "VG"}}, {"pk": 244, "model": "embargo.country", "fields": {"country": "VI"}}, {"pk": 242, "model": "embargo.country", "fields": {"country": "VN"}}, {"pk": 240, "model": "embargo.country", "fields": {"country": "VU"}}, {"pk": 245, "model": "embargo.country", "fields": {"country": "WF"}}, {"pk": 191, "model": "embargo.country", "fields": {"country": "WS"}}, {"pk": 247, "model": "embargo.country", "fields": {"country": "YE"}}, {"pk": 141, "model": "embargo.country", "fields": {"country": "YT"}}, {"pk": 205, "model": "embargo.country", "fields": {"country": "ZA"}}, {"pk": 248, "model": "embargo.country", "fields": {"country": "ZM"}}, {"pk": 249, "model": "embargo.country", "fields": {"country": "ZW"}}, {"pk": 1, "model": "edxval.profile", "fields": {"profile_name": "desktop_mp4"}}, {"pk": 2, "model": "edxval.profile", "fields": {"profile_name": "desktop_webm"}}, {"pk": 3, "model": "edxval.profile", "fields": {"profile_name": "mobile_high"}}, {"pk": 4, "model": "edxval.profile", "fields": {"profile_name": "mobile_low"}}, {"pk": 5, "model": "edxval.profile", "fields": {"profile_name": "youtube"}}, {"pk": 1, "model": "milestones.milestonerelationshiptype", "fields": {"active": true, "description": "Autogenerated milestone relationship type \"fulfills\"", "modified": "2015-06-17T19:56:39Z", "name": "fulfills", "created": "2015-06-17T19:56:39Z"}}, {"pk": 2, "model": "milestones.milestonerelationshiptype", "fields": {"active": true, "description": "Autogenerated milestone relationship type \"requires\"", "modified": "2015-06-17T19:56:39Z", "name": "requires", "created": "2015-06-17T19:56:39Z"}}, {"pk": 61, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 21}}, {"pk": 62, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 21}}, {"pk": 63, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 21}}, {"pk": 493, "model": "auth.permission", "fields": {"codename": "add_aiclassifier", "name": "Can add ai classifier", "content_type": 164}}, {"pk": 494, "model": "auth.permission", "fields": {"codename": "change_aiclassifier", "name": "Can change ai classifier", "content_type": 164}}, {"pk": 495, "model": "auth.permission", "fields": {"codename": "delete_aiclassifier", "name": "Can delete ai classifier", "content_type": 164}}, {"pk": 490, "model": "auth.permission", "fields": {"codename": "add_aiclassifierset", "name": "Can add ai classifier set", "content_type": 163}}, {"pk": 491, "model": "auth.permission", "fields": {"codename": "change_aiclassifierset", "name": "Can change ai classifier set", "content_type": 163}}, {"pk": 492, "model": "auth.permission", "fields": {"codename": "delete_aiclassifierset", "name": "Can delete ai classifier set", "content_type": 163}}, {"pk": 499, "model": "auth.permission", "fields": {"codename": "add_aigradingworkflow", "name": "Can add ai grading workflow", "content_type": 166}}, {"pk": 500, "model": "auth.permission", "fields": {"codename": "change_aigradingworkflow", "name": "Can change ai grading workflow", "content_type": 166}}, {"pk": 501, "model": "auth.permission", "fields": {"codename": "delete_aigradingworkflow", "name": "Can delete ai grading workflow", "content_type": 166}}, {"pk": 496, "model": "auth.permission", "fields": {"codename": "add_aitrainingworkflow", "name": "Can add ai training workflow", "content_type": 165}}, {"pk": 497, "model": "auth.permission", "fields": {"codename": "change_aitrainingworkflow", "name": "Can change ai training workflow", "content_type": 165}}, {"pk": 498, "model": "auth.permission", "fields": {"codename": "delete_aitrainingworkflow", "name": "Can delete ai training workflow", "content_type": 165}}, {"pk": 463, "model": "auth.permission", "fields": {"codename": "add_assessment", "name": "Can add assessment", "content_type": 154}}, {"pk": 464, "model": "auth.permission", "fields": {"codename": "change_assessment", "name": "Can change assessment", "content_type": 154}}, {"pk": 465, "model": "auth.permission", "fields": {"codename": "delete_assessment", "name": "Can delete assessment", "content_type": 154}}, {"pk": 472, "model": "auth.permission", "fields": {"codename": "add_assessmentfeedback", "name": "Can add assessment feedback", "content_type": 157}}, {"pk": 473, "model": "auth.permission", "fields": {"codename": "change_assessmentfeedback", "name": "Can change assessment feedback", "content_type": 157}}, {"pk": 474, "model": "auth.permission", "fields": {"codename": "delete_assessmentfeedback", "name": "Can delete assessment feedback", "content_type": 157}}, {"pk": 469, "model": "auth.permission", "fields": {"codename": "add_assessmentfeedbackoption", "name": "Can add assessment feedback option", "content_type": 156}}, {"pk": 470, "model": "auth.permission", "fields": {"codename": "change_assessmentfeedbackoption", "name": "Can change assessment feedback option", "content_type": 156}}, {"pk": 471, "model": "auth.permission", "fields": {"codename": "delete_assessmentfeedbackoption", "name": "Can delete assessment feedback option", "content_type": 156}}, {"pk": 466, "model": "auth.permission", "fields": {"codename": "add_assessmentpart", "name": "Can add assessment part", "content_type": 155}}, {"pk": 467, "model": "auth.permission", "fields": {"codename": "change_assessmentpart", "name": "Can change assessment part", "content_type": 155}}, {"pk": 468, "model": "auth.permission", "fields": {"codename": "delete_assessmentpart", "name": "Can delete assessment part", "content_type": 155}}, {"pk": 457, "model": "auth.permission", "fields": {"codename": "add_criterion", "name": "Can add criterion", "content_type": 152}}, {"pk": 458, "model": "auth.permission", "fields": {"codename": "change_criterion", "name": "Can change criterion", "content_type": 152}}, {"pk": 459, "model": "auth.permission", "fields": {"codename": "delete_criterion", "name": "Can delete criterion", "content_type": 152}}, {"pk": 460, "model": "auth.permission", "fields": {"codename": "add_criterionoption", "name": "Can add criterion option", "content_type": 153}}, {"pk": 461, "model": "auth.permission", "fields": {"codename": "change_criterionoption", "name": "Can change criterion option", "content_type": 153}}, {"pk": 462, "model": "auth.permission", "fields": {"codename": "delete_criterionoption", "name": "Can delete criterion option", "content_type": 153}}, {"pk": 475, "model": "auth.permission", "fields": {"codename": "add_peerworkflow", "name": "Can add peer workflow", "content_type": 158}}, {"pk": 476, "model": "auth.permission", "fields": {"codename": "change_peerworkflow", "name": "Can change peer workflow", "content_type": 158}}, {"pk": 477, "model": "auth.permission", "fields": {"codename": "delete_peerworkflow", "name": "Can delete peer workflow", "content_type": 158}}, {"pk": 478, "model": "auth.permission", "fields": {"codename": "add_peerworkflowitem", "name": "Can add peer workflow item", "content_type": 159}}, {"pk": 479, "model": "auth.permission", "fields": {"codename": "change_peerworkflowitem", "name": "Can change peer workflow item", "content_type": 159}}, {"pk": 480, "model": "auth.permission", "fields": {"codename": "delete_peerworkflowitem", "name": "Can delete peer workflow item", "content_type": 159}}, {"pk": 454, "model": "auth.permission", "fields": {"codename": "add_rubric", "name": "Can add rubric", "content_type": 151}}, {"pk": 455, "model": "auth.permission", "fields": {"codename": "change_rubric", "name": "Can change rubric", "content_type": 151}}, {"pk": 456, "model": "auth.permission", "fields": {"codename": "delete_rubric", "name": "Can delete rubric", "content_type": 151}}, {"pk": 484, "model": "auth.permission", "fields": {"codename": "add_studenttrainingworkflow", "name": "Can add student training workflow", "content_type": 161}}, {"pk": 485, "model": "auth.permission", "fields": {"codename": "change_studenttrainingworkflow", "name": "Can change student training workflow", "content_type": 161}}, {"pk": 486, "model": "auth.permission", "fields": {"codename": "delete_studenttrainingworkflow", "name": "Can delete student training workflow", "content_type": 161}}, {"pk": 487, "model": "auth.permission", "fields": {"codename": "add_studenttrainingworkflowitem", "name": "Can add student training workflow item", "content_type": 162}}, {"pk": 488, "model": "auth.permission", "fields": {"codename": "change_studenttrainingworkflowitem", "name": "Can change student training workflow item", "content_type": 162}}, {"pk": 489, "model": "auth.permission", "fields": {"codename": "delete_studenttrainingworkflowitem", "name": "Can delete student training workflow item", "content_type": 162}}, {"pk": 481, "model": "auth.permission", "fields": {"codename": "add_trainingexample", "name": "Can add training example", "content_type": 160}}, {"pk": 482, "model": "auth.permission", "fields": {"codename": "change_trainingexample", "name": "Can change training example", "content_type": 160}}, {"pk": 483, "model": "auth.permission", "fields": {"codename": "delete_trainingexample", "name": "Can delete training example", "content_type": 160}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, {"pk": 229, "model": "auth.permission", "fields": {"codename": "add_brandingapiconfig", "name": "Can add branding api config", "content_type": 77}}, {"pk": 230, "model": "auth.permission", "fields": {"codename": "change_brandingapiconfig", "name": "Can change branding api config", "content_type": 77}}, {"pk": 231, "model": "auth.permission", "fields": {"codename": "delete_brandingapiconfig", "name": "Can delete branding api config", "content_type": 77}}, {"pk": 226, "model": "auth.permission", "fields": {"codename": "add_brandinginfoconfig", "name": "Can add branding info config", "content_type": 76}}, {"pk": 227, "model": "auth.permission", "fields": {"codename": "change_brandinginfoconfig", "name": "Can change branding info config", "content_type": 76}}, {"pk": 228, "model": "auth.permission", "fields": {"codename": "delete_brandinginfoconfig", "name": "Can delete branding info config", "content_type": 76}}, {"pk": 223, "model": "auth.permission", "fields": {"codename": "add_courseauthorization", "name": "Can add course authorization", "content_type": 75}}, {"pk": 224, "model": "auth.permission", "fields": {"codename": "change_courseauthorization", "name": "Can change course authorization", "content_type": 75}}, {"pk": 225, "model": "auth.permission", "fields": {"codename": "delete_courseauthorization", "name": "Can delete course authorization", "content_type": 75}}, {"pk": 214, "model": "auth.permission", "fields": {"codename": "add_courseemail", "name": "Can add course email", "content_type": 72}}, {"pk": 215, "model": "auth.permission", "fields": {"codename": "change_courseemail", "name": "Can change course email", "content_type": 72}}, {"pk": 216, "model": "auth.permission", "fields": {"codename": "delete_courseemail", "name": "Can delete course email", "content_type": 72}}, {"pk": 220, "model": "auth.permission", "fields": {"codename": "add_courseemailtemplate", "name": "Can add course email template", "content_type": 74}}, {"pk": 221, "model": "auth.permission", "fields": {"codename": "change_courseemailtemplate", "name": "Can change course email template", "content_type": 74}}, {"pk": 222, "model": "auth.permission", "fields": {"codename": "delete_courseemailtemplate", "name": "Can delete course email template", "content_type": 74}}, {"pk": 217, "model": "auth.permission", "fields": {"codename": "add_optout", "name": "Can add optout", "content_type": 73}}, {"pk": 218, "model": "auth.permission", "fields": {"codename": "change_optout", "name": "Can change optout", "content_type": 73}}, {"pk": 219, "model": "auth.permission", "fields": {"codename": "delete_optout", "name": "Can delete optout", "content_type": 73}}, {"pk": 187, "model": "auth.permission", "fields": {"codename": "add_badgeassertion", "name": "Can add badge assertion", "content_type": 63}}, {"pk": 188, "model": "auth.permission", "fields": {"codename": "change_badgeassertion", "name": "Can change badge assertion", "content_type": 63}}, {"pk": 189, "model": "auth.permission", "fields": {"codename": "delete_badgeassertion", "name": "Can delete badge assertion", "content_type": 63}}, {"pk": 190, "model": "auth.permission", "fields": {"codename": "add_badgeimageconfiguration", "name": "Can add badge image configuration", "content_type": 64}}, {"pk": 191, "model": "auth.permission", "fields": {"codename": "change_badgeimageconfiguration", "name": "Can change badge image configuration", "content_type": 64}}, {"pk": 192, "model": "auth.permission", "fields": {"codename": "delete_badgeimageconfiguration", "name": "Can delete badge image configuration", "content_type": 64}}, {"pk": 181, "model": "auth.permission", "fields": {"codename": "add_certificategenerationconfiguration", "name": "Can add certificate generation configuration", "content_type": 61}}, {"pk": 182, "model": "auth.permission", "fields": {"codename": "change_certificategenerationconfiguration", "name": "Can change certificate generation configuration", "content_type": 61}}, {"pk": 183, "model": "auth.permission", "fields": {"codename": "delete_certificategenerationconfiguration", "name": "Can delete certificate generation configuration", "content_type": 61}}, {"pk": 178, "model": "auth.permission", "fields": {"codename": "add_certificategenerationcoursesetting", "name": "Can add certificate generation course setting", "content_type": 60}}, {"pk": 179, "model": "auth.permission", "fields": {"codename": "change_certificategenerationcoursesetting", "name": "Can change certificate generation course setting", "content_type": 60}}, {"pk": 180, "model": "auth.permission", "fields": {"codename": "delete_certificategenerationcoursesetting", "name": "Can delete certificate generation course setting", "content_type": 60}}, {"pk": 184, "model": "auth.permission", "fields": {"codename": "add_certificatehtmlviewconfiguration", "name": "Can add certificate html view configuration", "content_type": 62}}, {"pk": 185, "model": "auth.permission", "fields": {"codename": "change_certificatehtmlviewconfiguration", "name": "Can change certificate html view configuration", "content_type": 62}}, {"pk": 186, "model": "auth.permission", "fields": {"codename": "delete_certificatehtmlviewconfiguration", "name": "Can delete certificate html view configuration", "content_type": 62}}, {"pk": 166, "model": "auth.permission", "fields": {"codename": "add_certificatewhitelist", "name": "Can add certificate whitelist", "content_type": 56}}, {"pk": 167, "model": "auth.permission", "fields": {"codename": "change_certificatewhitelist", "name": "Can change certificate whitelist", "content_type": 56}}, {"pk": 168, "model": "auth.permission", "fields": {"codename": "delete_certificatewhitelist", "name": "Can delete certificate whitelist", "content_type": 56}}, {"pk": 175, "model": "auth.permission", "fields": {"codename": "add_examplecertificate", "name": "Can add example certificate", "content_type": 59}}, {"pk": 176, "model": "auth.permission", "fields": {"codename": "change_examplecertificate", "name": "Can change example certificate", "content_type": 59}}, {"pk": 177, "model": "auth.permission", "fields": {"codename": "delete_examplecertificate", "name": "Can delete example certificate", "content_type": 59}}, {"pk": 172, "model": "auth.permission", "fields": {"codename": "add_examplecertificateset", "name": "Can add example certificate set", "content_type": 58}}, {"pk": 173, "model": "auth.permission", "fields": {"codename": "change_examplecertificateset", "name": "Can change example certificate set", "content_type": 58}}, {"pk": 174, "model": "auth.permission", "fields": {"codename": "delete_examplecertificateset", "name": "Can delete example certificate set", "content_type": 58}}, {"pk": 169, "model": "auth.permission", "fields": {"codename": "add_generatedcertificate", "name": "Can add generated certificate", "content_type": 57}}, {"pk": 170, "model": "auth.permission", "fields": {"codename": "change_generatedcertificate", "name": "Can change generated certificate", "content_type": 57}}, {"pk": 171, "model": "auth.permission", "fields": {"codename": "delete_generatedcertificate", "name": "Can delete generated certificate", "content_type": 57}}, {"pk": 46, "model": "auth.permission", "fields": {"codename": "add_servercircuit", "name": "Can add server circuit", "content_type": 16}}, {"pk": 47, "model": "auth.permission", "fields": {"codename": "change_servercircuit", "name": "Can change server circuit", "content_type": 16}}, {"pk": 48, "model": "auth.permission", "fields": {"codename": "delete_servercircuit", "name": "Can delete server circuit", "content_type": 16}}, {"pk": 565, "model": "auth.permission", "fields": {"codename": "add_pushnotificationconfig", "name": "Can add push notification config", "content_type": 188}}, {"pk": 566, "model": "auth.permission", "fields": {"codename": "change_pushnotificationconfig", "name": "Can change push notification config", "content_type": 188}}, {"pk": 567, "model": "auth.permission", "fields": {"codename": "delete_pushnotificationconfig", "name": "Can delete push notification config", "content_type": 188}}, {"pk": 562, "model": "auth.permission", "fields": {"codename": "add_videouploadconfig", "name": "Can add video upload config", "content_type": 187}}, {"pk": 563, "model": "auth.permission", "fields": {"codename": "change_videouploadconfig", "name": "Can change video upload config", "content_type": 187}}, {"pk": 564, "model": "auth.permission", "fields": {"codename": "delete_videouploadconfig", "name": "Can delete video upload config", "content_type": 187}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 4}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 4}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 4}}, {"pk": 64, "model": "auth.permission", "fields": {"codename": "add_corsmodel", "name": "Can add cors model", "content_type": 22}}, {"pk": 65, "model": "auth.permission", "fields": {"codename": "change_corsmodel", "name": "Can change cors model", "content_type": 22}}, {"pk": 66, "model": "auth.permission", "fields": {"codename": "delete_corsmodel", "name": "Can delete cors model", "content_type": 22}}, {"pk": 439, "model": "auth.permission", "fields": {"codename": "add_xdomainproxyconfiguration", "name": "Can add x domain proxy configuration", "content_type": 146}}, {"pk": 440, "model": "auth.permission", "fields": {"codename": "change_xdomainproxyconfiguration", "name": "Can change x domain proxy configuration", "content_type": 146}}, {"pk": 441, "model": "auth.permission", "fields": {"codename": "delete_xdomainproxyconfiguration", "name": "Can delete x domain proxy configuration", "content_type": 146}}, {"pk": 94, "model": "auth.permission", "fields": {"codename": "add_offlinecomputedgrade", "name": "Can add offline computed grade", "content_type": 32}}, {"pk": 95, "model": "auth.permission", "fields": {"codename": "change_offlinecomputedgrade", "name": "Can change offline computed grade", "content_type": 32}}, {"pk": 96, "model": "auth.permission", "fields": {"codename": "delete_offlinecomputedgrade", "name": "Can delete offline computed grade", "content_type": 32}}, {"pk": 97, "model": "auth.permission", "fields": {"codename": "add_offlinecomputedgradelog", "name": "Can add offline computed grade log", "content_type": 33}}, {"pk": 98, "model": "auth.permission", "fields": {"codename": "change_offlinecomputedgradelog", "name": "Can change offline computed grade log", "content_type": 33}}, {"pk": 99, "model": "auth.permission", "fields": {"codename": "delete_offlinecomputedgradelog", "name": "Can delete offline computed grade log", "content_type": 33}}, {"pk": 100, "model": "auth.permission", "fields": {"codename": "add_studentfieldoverride", "name": "Can add student field override", "content_type": 34}}, {"pk": 101, "model": "auth.permission", "fields": {"codename": "change_studentfieldoverride", "name": "Can change student field override", "content_type": 34}}, {"pk": 102, "model": "auth.permission", "fields": {"codename": "delete_studentfieldoverride", "name": "Can delete student field override", "content_type": 34}}, {"pk": 79, "model": "auth.permission", "fields": {"codename": "add_studentmodule", "name": "Can add student module", "content_type": 27}}, {"pk": 80, "model": "auth.permission", "fields": {"codename": "change_studentmodule", "name": "Can change student module", "content_type": 27}}, {"pk": 81, "model": "auth.permission", "fields": {"codename": "delete_studentmodule", "name": "Can delete student module", "content_type": 27}}, {"pk": 82, "model": "auth.permission", "fields": {"codename": "add_studentmodulehistory", "name": "Can add student module history", "content_type": 28}}, {"pk": 83, "model": "auth.permission", "fields": {"codename": "change_studentmodulehistory", "name": "Can change student module history", "content_type": 28}}, {"pk": 84, "model": "auth.permission", "fields": {"codename": "delete_studentmodulehistory", "name": "Can delete student module history", "content_type": 28}}, {"pk": 91, "model": "auth.permission", "fields": {"codename": "add_xmodulestudentinfofield", "name": "Can add x module student info field", "content_type": 31}}, {"pk": 92, "model": "auth.permission", "fields": {"codename": "change_xmodulestudentinfofield", "name": "Can change x module student info field", "content_type": 31}}, {"pk": 93, "model": "auth.permission", "fields": {"codename": "delete_xmodulestudentinfofield", "name": "Can delete x module student info field", "content_type": 31}}, {"pk": 88, "model": "auth.permission", "fields": {"codename": "add_xmodulestudentprefsfield", "name": "Can add x module student prefs field", "content_type": 30}}, {"pk": 89, "model": "auth.permission", "fields": {"codename": "change_xmodulestudentprefsfield", "name": "Can change x module student prefs field", "content_type": 30}}, {"pk": 90, "model": "auth.permission", "fields": {"codename": "delete_xmodulestudentprefsfield", "name": "Can delete x module student prefs field", "content_type": 30}}, {"pk": 85, "model": "auth.permission", "fields": {"codename": "add_xmoduleuserstatesummaryfield", "name": "Can add x module user state summary field", "content_type": 29}}, {"pk": 86, "model": "auth.permission", "fields": {"codename": "change_xmoduleuserstatesummaryfield", "name": "Can change x module user state summary field", "content_type": 29}}, {"pk": 87, "model": "auth.permission", "fields": {"codename": "delete_xmoduleuserstatesummaryfield", "name": "Can delete x module user state summary field", "content_type": 29}}, {"pk": 421, "model": "auth.permission", "fields": {"codename": "add_coursererunstate", "name": "Can add course rerun state", "content_type": 140}}, {"pk": 422, "model": "auth.permission", "fields": {"codename": "change_coursererunstate", "name": "Can change course rerun state", "content_type": 140}}, {"pk": 423, "model": "auth.permission", "fields": {"codename": "delete_coursererunstate", "name": "Can delete course rerun state", "content_type": 140}}, {"pk": 568, "model": "auth.permission", "fields": {"codename": "add_coursecreator", "name": "Can add course creator", "content_type": 189}}, {"pk": 569, "model": "auth.permission", "fields": {"codename": "change_coursecreator", "name": "Can change course creator", "content_type": 189}}, {"pk": 570, "model": "auth.permission", "fields": {"codename": "delete_coursecreator", "name": "Can delete course creator", "content_type": 189}}, {"pk": 211, "model": "auth.permission", "fields": {"codename": "add_coursecohort", "name": "Can add course cohort", "content_type": 71}}, {"pk": 212, "model": "auth.permission", "fields": {"codename": "change_coursecohort", "name": "Can change course cohort", "content_type": 71}}, {"pk": 213, "model": "auth.permission", "fields": {"codename": "delete_coursecohort", "name": "Can delete course cohort", "content_type": 71}}, {"pk": 208, "model": "auth.permission", "fields": {"codename": "add_coursecohortssettings", "name": "Can add course cohorts settings", "content_type": 70}}, {"pk": 209, "model": "auth.permission", "fields": {"codename": "change_coursecohortssettings", "name": "Can change course cohorts settings", "content_type": 70}}, {"pk": 210, "model": "auth.permission", "fields": {"codename": "delete_coursecohortssettings", "name": "Can delete course cohorts settings", "content_type": 70}}, {"pk": 202, "model": "auth.permission", "fields": {"codename": "add_courseusergroup", "name": "Can add course user group", "content_type": 68}}, {"pk": 203, "model": "auth.permission", "fields": {"codename": "change_courseusergroup", "name": "Can change course user group", "content_type": 68}}, {"pk": 204, "model": "auth.permission", "fields": {"codename": "delete_courseusergroup", "name": "Can delete course user group", "content_type": 68}}, {"pk": 205, "model": "auth.permission", "fields": {"codename": "add_courseusergrouppartitiongroup", "name": "Can add course user group partition group", "content_type": 69}}, {"pk": 206, "model": "auth.permission", "fields": {"codename": "change_courseusergrouppartitiongroup", "name": "Can change course user group partition group", "content_type": 69}}, {"pk": 207, "model": "auth.permission", "fields": {"codename": "delete_courseusergrouppartitiongroup", "name": "Can delete course user group partition group", "content_type": 69}}, {"pk": 376, "model": "auth.permission", "fields": {"codename": "add_coursemode", "name": "Can add course mode", "content_type": 125}}, {"pk": 377, "model": "auth.permission", "fields": {"codename": "change_coursemode", "name": "Can change course mode", "content_type": 125}}, {"pk": 378, "model": "auth.permission", "fields": {"codename": "delete_coursemode", "name": "Can delete course mode", "content_type": 125}}, {"pk": 379, "model": "auth.permission", "fields": {"codename": "add_coursemodesarchive", "name": "Can add course modes archive", "content_type": 126}}, {"pk": 380, "model": "auth.permission", "fields": {"codename": "change_coursemodesarchive", "name": "Can change course modes archive", "content_type": 126}}, {"pk": 381, "model": "auth.permission", "fields": {"codename": "delete_coursemodesarchive", "name": "Can delete course modes archive", "content_type": 126}}, {"pk": 436, "model": "auth.permission", "fields": {"codename": "add_coursestructure", "name": "Can add course structure", "content_type": 145}}, {"pk": 437, "model": "auth.permission", "fields": {"codename": "change_coursestructure", "name": "Can change course structure", "content_type": 145}}, {"pk": 438, "model": "auth.permission", "fields": {"codename": "delete_coursestructure", "name": "Can delete course structure", "content_type": 145}}, {"pk": 544, "model": "auth.permission", "fields": {"codename": "add_creditcourse", "name": "Can add credit course", "content_type": 181}}, {"pk": 545, "model": "auth.permission", "fields": {"codename": "change_creditcourse", "name": "Can change credit course", "content_type": 181}}, {"pk": 546, "model": "auth.permission", "fields": {"codename": "delete_creditcourse", "name": "Can delete credit course", "content_type": 181}}, {"pk": 553, "model": "auth.permission", "fields": {"codename": "add_crediteligibility", "name": "Can add credit eligibility", "content_type": 184}}, {"pk": 554, "model": "auth.permission", "fields": {"codename": "change_crediteligibility", "name": "Can change credit eligibility", "content_type": 184}}, {"pk": 555, "model": "auth.permission", "fields": {"codename": "delete_crediteligibility", "name": "Can delete credit eligibility", "content_type": 184}}, {"pk": 541, "model": "auth.permission", "fields": {"codename": "add_creditprovider", "name": "Can add credit provider", "content_type": 180}}, {"pk": 542, "model": "auth.permission", "fields": {"codename": "change_creditprovider", "name": "Can change credit provider", "content_type": 180}}, {"pk": 543, "model": "auth.permission", "fields": {"codename": "delete_creditprovider", "name": "Can delete credit provider", "content_type": 180}}, {"pk": 559, "model": "auth.permission", "fields": {"codename": "add_creditrequest", "name": "Can add credit request", "content_type": 186}}, {"pk": 560, "model": "auth.permission", "fields": {"codename": "change_creditrequest", "name": "Can change credit request", "content_type": 186}}, {"pk": 561, "model": "auth.permission", "fields": {"codename": "delete_creditrequest", "name": "Can delete credit request", "content_type": 186}}, {"pk": 547, "model": "auth.permission", "fields": {"codename": "add_creditrequirement", "name": "Can add credit requirement", "content_type": 182}}, {"pk": 548, "model": "auth.permission", "fields": {"codename": "change_creditrequirement", "name": "Can change credit requirement", "content_type": 182}}, {"pk": 549, "model": "auth.permission", "fields": {"codename": "delete_creditrequirement", "name": "Can delete credit requirement", "content_type": 182}}, {"pk": 550, "model": "auth.permission", "fields": {"codename": "add_creditrequirementstatus", "name": "Can add credit requirement status", "content_type": 183}}, {"pk": 551, "model": "auth.permission", "fields": {"codename": "change_creditrequirementstatus", "name": "Can change credit requirement status", "content_type": 183}}, {"pk": 552, "model": "auth.permission", "fields": {"codename": "delete_creditrequirementstatus", "name": "Can delete credit requirement status", "content_type": 183}}, {"pk": 556, "model": "auth.permission", "fields": {"codename": "add_historicalcreditrequest", "name": "Can add historical credit request", "content_type": 185}}, {"pk": 557, "model": "auth.permission", "fields": {"codename": "change_historicalcreditrequest", "name": "Can change historical credit request", "content_type": 185}}, {"pk": 558, "model": "auth.permission", "fields": {"codename": "delete_historicalcreditrequest", "name": "Can delete historical credit request", "content_type": 185}}, {"pk": 397, "model": "auth.permission", "fields": {"codename": "add_darklangconfig", "name": "Can add dark lang config", "content_type": 132}}, {"pk": 398, "model": "auth.permission", "fields": {"codename": "change_darklangconfig", "name": "Can change dark lang config", "content_type": 132}}, {"pk": 399, "model": "auth.permission", "fields": {"codename": "delete_darklangconfig", "name": "Can delete dark lang config", "content_type": 132}}, {"pk": 73, "model": "auth.permission", "fields": {"codename": "add_association", "name": "Can add association", "content_type": 25}}, {"pk": 74, "model": "auth.permission", "fields": {"codename": "change_association", "name": "Can change association", "content_type": 25}}, {"pk": 75, "model": "auth.permission", "fields": {"codename": "delete_association", "name": "Can delete association", "content_type": 25}}, {"pk": 76, "model": "auth.permission", "fields": {"codename": "add_code", "name": "Can add code", "content_type": 26}}, {"pk": 77, "model": "auth.permission", "fields": {"codename": "change_code", "name": "Can change code", "content_type": 26}}, {"pk": 78, "model": "auth.permission", "fields": {"codename": "delete_code", "name": "Can delete code", "content_type": 26}}, {"pk": 70, "model": "auth.permission", "fields": {"codename": "add_nonce", "name": "Can add nonce", "content_type": 24}}, {"pk": 71, "model": "auth.permission", "fields": {"codename": "change_nonce", "name": "Can change nonce", "content_type": 24}}, {"pk": 72, "model": "auth.permission", "fields": {"codename": "delete_nonce", "name": "Can delete nonce", "content_type": 24}}, {"pk": 67, "model": "auth.permission", "fields": {"codename": "add_usersocialauth", "name": "Can add user social auth", "content_type": 23}}, {"pk": 68, "model": "auth.permission", "fields": {"codename": "change_usersocialauth", "name": "Can change user social auth", "content_type": 23}}, {"pk": 69, "model": "auth.permission", "fields": {"codename": "delete_usersocialauth", "name": "Can delete user social auth", "content_type": 23}}, {"pk": 292, "model": "auth.permission", "fields": {"codename": "add_notification", "name": "Can add notification", "content_type": 97}}, {"pk": 293, "model": "auth.permission", "fields": {"codename": "change_notification", "name": "Can change notification", "content_type": 97}}, {"pk": 294, "model": "auth.permission", "fields": {"codename": "delete_notification", "name": "Can delete notification", "content_type": 97}}, {"pk": 283, "model": "auth.permission", "fields": {"codename": "add_notificationtype", "name": "Can add type", "content_type": 94}}, {"pk": 284, "model": "auth.permission", "fields": {"codename": "change_notificationtype", "name": "Can change type", "content_type": 94}}, {"pk": 285, "model": "auth.permission", "fields": {"codename": "delete_notificationtype", "name": "Can delete type", "content_type": 94}}, {"pk": 286, "model": "auth.permission", "fields": {"codename": "add_settings", "name": "Can add settings", "content_type": 95}}, {"pk": 287, "model": "auth.permission", "fields": {"codename": "change_settings", "name": "Can change settings", "content_type": 95}}, {"pk": 288, "model": "auth.permission", "fields": {"codename": "delete_settings", "name": "Can delete settings", "content_type": 95}}, {"pk": 289, "model": "auth.permission", "fields": {"codename": "add_subscription", "name": "Can add subscription", "content_type": 96}}, {"pk": 290, "model": "auth.permission", "fields": {"codename": "change_subscription", "name": "Can change subscription", "content_type": 96}}, {"pk": 291, "model": "auth.permission", "fields": {"codename": "delete_subscription", "name": "Can delete subscription", "content_type": 96}}, {"pk": 55, "model": "auth.permission", "fields": {"codename": "add_association", "name": "Can add association", "content_type": 19}}, {"pk": 56, "model": "auth.permission", "fields": {"codename": "change_association", "name": "Can change association", "content_type": 19}}, {"pk": 57, "model": "auth.permission", "fields": {"codename": "delete_association", "name": "Can delete association", "content_type": 19}}, {"pk": 52, "model": "auth.permission", "fields": {"codename": "add_nonce", "name": "Can add nonce", "content_type": 18}}, {"pk": 53, "model": "auth.permission", "fields": {"codename": "change_nonce", "name": "Can change nonce", "content_type": 18}}, {"pk": 54, "model": "auth.permission", "fields": {"codename": "delete_nonce", "name": "Can delete nonce", "content_type": 18}}, {"pk": 58, "model": "auth.permission", "fields": {"codename": "add_useropenid", "name": "Can add user open id", "content_type": 20}}, {"pk": 59, "model": "auth.permission", "fields": {"codename": "change_useropenid", "name": "Can change user open id", "content_type": 20}}, {"pk": 60, "model": "auth.permission", "fields": {"codename": "delete_useropenid", "name": "Can delete user open id", "content_type": 20}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_crontabschedule", "name": "Can add crontab", "content_type": 10}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_crontabschedule", "name": "Can change crontab", "content_type": 10}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_crontabschedule", "name": "Can delete crontab", "content_type": 10}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_intervalschedule", "name": "Can add interval", "content_type": 9}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_intervalschedule", "name": "Can change interval", "content_type": 9}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_intervalschedule", "name": "Can delete interval", "content_type": 9}}, {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_periodictask", "name": "Can add periodic task", "content_type": 12}}, {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_periodictask", "name": "Can change periodic task", "content_type": 12}}, {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_periodictask", "name": "Can delete periodic task", "content_type": 12}}, {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_periodictasks", "name": "Can add periodic tasks", "content_type": 11}}, {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_periodictasks", "name": "Can change periodic tasks", "content_type": 11}}, {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_periodictasks", "name": "Can delete periodic tasks", "content_type": 11}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_taskmeta", "name": "Can add task state", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_taskmeta", "name": "Can change task state", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_taskmeta", "name": "Can delete task state", "content_type": 7}}, {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_tasksetmeta", "name": "Can add saved group result", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_tasksetmeta", "name": "Can change saved group result", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_tasksetmeta", "name": "Can delete saved group result", "content_type": 8}}, {"pk": 40, "model": "auth.permission", "fields": {"codename": "add_taskstate", "name": "Can add task", "content_type": 14}}, {"pk": 41, "model": "auth.permission", "fields": {"codename": "change_taskstate", "name": "Can change task", "content_type": 14}}, {"pk": 42, "model": "auth.permission", "fields": {"codename": "delete_taskstate", "name": "Can delete task", "content_type": 14}}, {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_workerstate", "name": "Can add worker", "content_type": 13}}, {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_workerstate", "name": "Can change worker", "content_type": 13}}, {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_workerstate", "name": "Can delete worker", "content_type": 13}}, {"pk": 517, "model": "auth.permission", "fields": {"codename": "add_coursevideo", "name": "Can add course video", "content_type": 172}}, {"pk": 518, "model": "auth.permission", "fields": {"codename": "change_coursevideo", "name": "Can change course video", "content_type": 172}}, {"pk": 519, "model": "auth.permission", "fields": {"codename": "delete_coursevideo", "name": "Can delete course video", "content_type": 172}}, {"pk": 520, "model": "auth.permission", "fields": {"codename": "add_encodedvideo", "name": "Can add encoded video", "content_type": 173}}, {"pk": 521, "model": "auth.permission", "fields": {"codename": "change_encodedvideo", "name": "Can change encoded video", "content_type": 173}}, {"pk": 522, "model": "auth.permission", "fields": {"codename": "delete_encodedvideo", "name": "Can delete encoded video", "content_type": 173}}, {"pk": 511, "model": "auth.permission", "fields": {"codename": "add_profile", "name": "Can add profile", "content_type": 170}}, {"pk": 512, "model": "auth.permission", "fields": {"codename": "change_profile", "name": "Can change profile", "content_type": 170}}, {"pk": 513, "model": "auth.permission", "fields": {"codename": "delete_profile", "name": "Can delete profile", "content_type": 170}}, {"pk": 523, "model": "auth.permission", "fields": {"codename": "add_subtitle", "name": "Can add subtitle", "content_type": 174}}, {"pk": 524, "model": "auth.permission", "fields": {"codename": "change_subtitle", "name": "Can change subtitle", "content_type": 174}}, {"pk": 525, "model": "auth.permission", "fields": {"codename": "delete_subtitle", "name": "Can delete subtitle", "content_type": 174}}, {"pk": 514, "model": "auth.permission", "fields": {"codename": "add_video", "name": "Can add video", "content_type": 171}}, {"pk": 515, "model": "auth.permission", "fields": {"codename": "change_video", "name": "Can change video", "content_type": 171}}, {"pk": 516, "model": "auth.permission", "fields": {"codename": "delete_video", "name": "Can delete video", "content_type": 171}}, {"pk": 409, "model": "auth.permission", "fields": {"codename": "add_country", "name": "Can add country", "content_type": 136}}, {"pk": 410, "model": "auth.permission", "fields": {"codename": "change_country", "name": "Can change country", "content_type": 136}}, {"pk": 411, "model": "auth.permission", "fields": {"codename": "delete_country", "name": "Can delete country", "content_type": 136}}, {"pk": 412, "model": "auth.permission", "fields": {"codename": "add_countryaccessrule", "name": "Can add country access rule", "content_type": 137}}, {"pk": 413, "model": "auth.permission", "fields": {"codename": "change_countryaccessrule", "name": "Can change country access rule", "content_type": 137}}, {"pk": 414, "model": "auth.permission", "fields": {"codename": "delete_countryaccessrule", "name": "Can delete country access rule", "content_type": 137}}, {"pk": 415, "model": "auth.permission", "fields": {"codename": "add_courseaccessrulehistory", "name": "Can add course access rule history", "content_type": 138}}, {"pk": 416, "model": "auth.permission", "fields": {"codename": "change_courseaccessrulehistory", "name": "Can change course access rule history", "content_type": 138}}, {"pk": 417, "model": "auth.permission", "fields": {"codename": "delete_courseaccessrulehistory", "name": "Can delete course access rule history", "content_type": 138}}, {"pk": 400, "model": "auth.permission", "fields": {"codename": "add_embargoedcourse", "name": "Can add embargoed course", "content_type": 133}}, {"pk": 401, "model": "auth.permission", "fields": {"codename": "change_embargoedcourse", "name": "Can change embargoed course", "content_type": 133}}, {"pk": 402, "model": "auth.permission", "fields": {"codename": "delete_embargoedcourse", "name": "Can delete embargoed course", "content_type": 133}}, {"pk": 403, "model": "auth.permission", "fields": {"codename": "add_embargoedstate", "name": "Can add embargoed state", "content_type": 134}}, {"pk": 404, "model": "auth.permission", "fields": {"codename": "change_embargoedstate", "name": "Can change embargoed state", "content_type": 134}}, {"pk": 405, "model": "auth.permission", "fields": {"codename": "delete_embargoedstate", "name": "Can delete embargoed state", "content_type": 134}}, {"pk": 418, "model": "auth.permission", "fields": {"codename": "add_ipfilter", "name": "Can add ip filter", "content_type": 139}}, {"pk": 419, "model": "auth.permission", "fields": {"codename": "change_ipfilter", "name": "Can change ip filter", "content_type": 139}}, {"pk": 420, "model": "auth.permission", "fields": {"codename": "delete_ipfilter", "name": "Can delete ip filter", "content_type": 139}}, {"pk": 406, "model": "auth.permission", "fields": {"codename": "add_restrictedcourse", "name": "Can add restricted course", "content_type": 135}}, {"pk": 407, "model": "auth.permission", "fields": {"codename": "change_restrictedcourse", "name": "Can change restricted course", "content_type": 135}}, {"pk": 408, "model": "auth.permission", "fields": {"codename": "delete_restrictedcourse", "name": "Can delete restricted course", "content_type": 135}}, {"pk": 232, "model": "auth.permission", "fields": {"codename": "add_externalauthmap", "name": "Can add external auth map", "content_type": 78}}, {"pk": 233, "model": "auth.permission", "fields": {"codename": "change_externalauthmap", "name": "Can change external auth map", "content_type": 78}}, {"pk": 234, "model": "auth.permission", "fields": {"codename": "delete_externalauthmap", "name": "Can delete external auth map", "content_type": 78}}, {"pk": 298, "model": "auth.permission", "fields": {"codename": "add_puzzlecomplete", "name": "Can add puzzle complete", "content_type": 99}}, {"pk": 299, "model": "auth.permission", "fields": {"codename": "change_puzzlecomplete", "name": "Can change puzzle complete", "content_type": 99}}, {"pk": 300, "model": "auth.permission", "fields": {"codename": "delete_puzzlecomplete", "name": "Can delete puzzle complete", "content_type": 99}}, {"pk": 295, "model": "auth.permission", "fields": {"codename": "add_score", "name": "Can add score", "content_type": 98}}, {"pk": 296, "model": "auth.permission", "fields": {"codename": "change_score", "name": "Can change score", "content_type": 98}}, {"pk": 297, "model": "auth.permission", "fields": {"codename": "delete_score", "name": "Can delete score", "content_type": 98}}, {"pk": 193, "model": "auth.permission", "fields": {"codename": "add_instructortask", "name": "Can add instructor task", "content_type": 65}}, {"pk": 194, "model": "auth.permission", "fields": {"codename": "change_instructortask", "name": "Can change instructor task", "content_type": 65}}, {"pk": 195, "model": "auth.permission", "fields": {"codename": "delete_instructortask", "name": "Can delete instructor task", "content_type": 65}}, {"pk": 196, "model": "auth.permission", "fields": {"codename": "add_coursesoftware", "name": "Can add course software", "content_type": 66}}, {"pk": 197, "model": "auth.permission", "fields": {"codename": "change_coursesoftware", "name": "Can change course software", "content_type": 66}}, {"pk": 198, "model": "auth.permission", "fields": {"codename": "delete_coursesoftware", "name": "Can delete course software", "content_type": 66}}, {"pk": 199, "model": "auth.permission", "fields": {"codename": "add_userlicense", "name": "Can add user license", "content_type": 67}}, {"pk": 200, "model": "auth.permission", "fields": {"codename": "change_userlicense", "name": "Can change user license", "content_type": 67}}, {"pk": 201, "model": "auth.permission", "fields": {"codename": "delete_userlicense", "name": "Can delete user license", "content_type": 67}}, {"pk": 433, "model": "auth.permission", "fields": {"codename": "add_xblockasidesconfig", "name": "Can add x block asides config", "content_type": 144}}, {"pk": 434, "model": "auth.permission", "fields": {"codename": "change_xblockasidesconfig", "name": "Can change x block asides config", "content_type": 144}}, {"pk": 435, "model": "auth.permission", "fields": {"codename": "delete_xblockasidesconfig", "name": "Can delete x block asides config", "content_type": 144}}, {"pk": 535, "model": "auth.permission", "fields": {"codename": "add_coursecontentmilestone", "name": "Can add course content milestone", "content_type": 178}}, {"pk": 536, "model": "auth.permission", "fields": {"codename": "change_coursecontentmilestone", "name": "Can change course content milestone", "content_type": 178}}, {"pk": 537, "model": "auth.permission", "fields": {"codename": "delete_coursecontentmilestone", "name": "Can delete course content milestone", "content_type": 178}}, {"pk": 532, "model": "auth.permission", "fields": {"codename": "add_coursemilestone", "name": "Can add course milestone", "content_type": 177}}, {"pk": 533, "model": "auth.permission", "fields": {"codename": "change_coursemilestone", "name": "Can change course milestone", "content_type": 177}}, {"pk": 534, "model": "auth.permission", "fields": {"codename": "delete_coursemilestone", "name": "Can delete course milestone", "content_type": 177}}, {"pk": 526, "model": "auth.permission", "fields": {"codename": "add_milestone", "name": "Can add milestone", "content_type": 175}}, {"pk": 527, "model": "auth.permission", "fields": {"codename": "change_milestone", "name": "Can change milestone", "content_type": 175}}, {"pk": 528, "model": "auth.permission", "fields": {"codename": "delete_milestone", "name": "Can delete milestone", "content_type": 175}}, {"pk": 529, "model": "auth.permission", "fields": {"codename": "add_milestonerelationshiptype", "name": "Can add milestone relationship type", "content_type": 176}}, {"pk": 530, "model": "auth.permission", "fields": {"codename": "change_milestonerelationshiptype", "name": "Can change milestone relationship type", "content_type": 176}}, {"pk": 531, "model": "auth.permission", "fields": {"codename": "delete_milestonerelationshiptype", "name": "Can delete milestone relationship type", "content_type": 176}}, {"pk": 538, "model": "auth.permission", "fields": {"codename": "add_usermilestone", "name": "Can add user milestone", "content_type": 179}}, {"pk": 539, "model": "auth.permission", "fields": {"codename": "change_usermilestone", "name": "Can change user milestone", "content_type": 179}}, {"pk": 540, "model": "auth.permission", "fields": {"codename": "delete_usermilestone", "name": "Can delete user milestone", "content_type": 179}}, {"pk": 424, "model": "auth.permission", "fields": {"codename": "add_mobileapiconfig", "name": "Can add mobile api config", "content_type": 141}}, {"pk": 425, "model": "auth.permission", "fields": {"codename": "change_mobileapiconfig", "name": "Can change mobile api config", "content_type": 141}}, {"pk": 426, "model": "auth.permission", "fields": {"codename": "delete_mobileapiconfig", "name": "Can delete mobile api config", "content_type": 141}}, {"pk": 301, "model": "auth.permission", "fields": {"codename": "add_note", "name": "Can add note", "content_type": 100}}, {"pk": 302, "model": "auth.permission", "fields": {"codename": "change_note", "name": "Can change note", "content_type": 100}}, {"pk": 303, "model": "auth.permission", "fields": {"codename": "delete_note", "name": "Can delete note", "content_type": 100}}, {"pk": 241, "model": "auth.permission", "fields": {"codename": "add_accesstoken", "name": "Can add access token", "content_type": 81}}, {"pk": 242, "model": "auth.permission", "fields": {"codename": "change_accesstoken", "name": "Can change access token", "content_type": 81}}, {"pk": 243, "model": "auth.permission", "fields": {"codename": "delete_accesstoken", "name": "Can delete access token", "content_type": 81}}, {"pk": 235, "model": "auth.permission", "fields": {"codename": "add_client", "name": "Can add client", "content_type": 79}}, {"pk": 236, "model": "auth.permission", "fields": {"codename": "change_client", "name": "Can change client", "content_type": 79}}, {"pk": 237, "model": "auth.permission", "fields": {"codename": "delete_client", "name": "Can delete client", "content_type": 79}}, {"pk": 238, "model": "auth.permission", "fields": {"codename": "add_grant", "name": "Can add grant", "content_type": 80}}, {"pk": 239, "model": "auth.permission", "fields": {"codename": "change_grant", "name": "Can change grant", "content_type": 80}}, {"pk": 240, "model": "auth.permission", "fields": {"codename": "delete_grant", "name": "Can delete grant", "content_type": 80}}, {"pk": 244, "model": "auth.permission", "fields": {"codename": "add_refreshtoken", "name": "Can add refresh token", "content_type": 82}}, {"pk": 245, "model": "auth.permission", "fields": {"codename": "change_refreshtoken", "name": "Can change refresh token", "content_type": 82}}, {"pk": 246, "model": "auth.permission", "fields": {"codename": "delete_refreshtoken", "name": "Can delete refresh token", "content_type": 82}}, {"pk": 247, "model": "auth.permission", "fields": {"codename": "add_trustedclient", "name": "Can add trusted client", "content_type": 83}}, {"pk": 248, "model": "auth.permission", "fields": {"codename": "change_trustedclient", "name": "Can change trusted client", "content_type": 83}}, {"pk": 249, "model": "auth.permission", "fields": {"codename": "delete_trustedclient", "name": "Can delete trusted client", "content_type": 83}}, {"pk": 49, "model": "auth.permission", "fields": {"codename": "add_psychometricdata", "name": "Can add psychometric data", "content_type": 17}}, {"pk": 50, "model": "auth.permission", "fields": {"codename": "change_psychometricdata", "name": "Can change psychometric data", "content_type": 17}}, {"pk": 51, "model": "auth.permission", "fields": {"codename": "delete_psychometricdata", "name": "Can delete psychometric data", "content_type": 17}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 5}}, {"pk": 367, "model": "auth.permission", "fields": {"codename": "add_certificateitem", "name": "Can add certificate item", "content_type": 122}}, {"pk": 368, "model": "auth.permission", "fields": {"codename": "change_certificateitem", "name": "Can change certificate item", "content_type": 122}}, {"pk": 369, "model": "auth.permission", "fields": {"codename": "delete_certificateitem", "name": "Can delete certificate item", "content_type": 122}}, {"pk": 349, "model": "auth.permission", "fields": {"codename": "add_coupon", "name": "Can add coupon", "content_type": 116}}, {"pk": 350, "model": "auth.permission", "fields": {"codename": "change_coupon", "name": "Can change coupon", "content_type": 116}}, {"pk": 351, "model": "auth.permission", "fields": {"codename": "delete_coupon", "name": "Can delete coupon", "content_type": 116}}, {"pk": 352, "model": "auth.permission", "fields": {"codename": "add_couponredemption", "name": "Can add coupon redemption", "content_type": 117}}, {"pk": 353, "model": "auth.permission", "fields": {"codename": "change_couponredemption", "name": "Can change coupon redemption", "content_type": 117}}, {"pk": 354, "model": "auth.permission", "fields": {"codename": "delete_couponredemption", "name": "Can delete coupon redemption", "content_type": 117}}, {"pk": 358, "model": "auth.permission", "fields": {"codename": "add_courseregcodeitem", "name": "Can add course reg code item", "content_type": 119}}, {"pk": 359, "model": "auth.permission", "fields": {"codename": "change_courseregcodeitem", "name": "Can change course reg code item", "content_type": 119}}, {"pk": 360, "model": "auth.permission", "fields": {"codename": "delete_courseregcodeitem", "name": "Can delete course reg code item", "content_type": 119}}, {"pk": 361, "model": "auth.permission", "fields": {"codename": "add_courseregcodeitemannotation", "name": "Can add course reg code item annotation", "content_type": 120}}, {"pk": 362, "model": "auth.permission", "fields": {"codename": "change_courseregcodeitemannotation", "name": "Can change course reg code item annotation", "content_type": 120}}, {"pk": 363, "model": "auth.permission", "fields": {"codename": "delete_courseregcodeitemannotation", "name": "Can delete course reg code item annotation", "content_type": 120}}, {"pk": 343, "model": "auth.permission", "fields": {"codename": "add_courseregistrationcode", "name": "Can add course registration code", "content_type": 114}}, {"pk": 344, "model": "auth.permission", "fields": {"codename": "change_courseregistrationcode", "name": "Can change course registration code", "content_type": 114}}, {"pk": 345, "model": "auth.permission", "fields": {"codename": "delete_courseregistrationcode", "name": "Can delete course registration code", "content_type": 114}}, {"pk": 337, "model": "auth.permission", "fields": {"codename": "add_courseregistrationcodeinvoiceitem", "name": "Can add course registration code invoice item", "content_type": 112}}, {"pk": 338, "model": "auth.permission", "fields": {"codename": "change_courseregistrationcodeinvoiceitem", "name": "Can change course registration code invoice item", "content_type": 112}}, {"pk": 339, "model": "auth.permission", "fields": {"codename": "delete_courseregistrationcodeinvoiceitem", "name": "Can delete course registration code invoice item", "content_type": 112}}, {"pk": 373, "model": "auth.permission", "fields": {"codename": "add_donation", "name": "Can add donation", "content_type": 124}}, {"pk": 374, "model": "auth.permission", "fields": {"codename": "change_donation", "name": "Can change donation", "content_type": 124}}, {"pk": 375, "model": "auth.permission", "fields": {"codename": "delete_donation", "name": "Can delete donation", "content_type": 124}}, {"pk": 370, "model": "auth.permission", "fields": {"codename": "add_donationconfiguration", "name": "Can add donation configuration", "content_type": 123}}, {"pk": 371, "model": "auth.permission", "fields": {"codename": "change_donationconfiguration", "name": "Can change donation configuration", "content_type": 123}}, {"pk": 372, "model": "auth.permission", "fields": {"codename": "delete_donationconfiguration", "name": "Can delete donation configuration", "content_type": 123}}, {"pk": 328, "model": "auth.permission", "fields": {"codename": "add_invoice", "name": "Can add invoice", "content_type": 109}}, {"pk": 329, "model": "auth.permission", "fields": {"codename": "change_invoice", "name": "Can change invoice", "content_type": 109}}, {"pk": 330, "model": "auth.permission", "fields": {"codename": "delete_invoice", "name": "Can delete invoice", "content_type": 109}}, {"pk": 340, "model": "auth.permission", "fields": {"codename": "add_invoicehistory", "name": "Can add invoice history", "content_type": 113}}, {"pk": 341, "model": "auth.permission", "fields": {"codename": "change_invoicehistory", "name": "Can change invoice history", "content_type": 113}}, {"pk": 342, "model": "auth.permission", "fields": {"codename": "delete_invoicehistory", "name": "Can delete invoice history", "content_type": 113}}, {"pk": 334, "model": "auth.permission", "fields": {"codename": "add_invoiceitem", "name": "Can add invoice item", "content_type": 111}}, {"pk": 335, "model": "auth.permission", "fields": {"codename": "change_invoiceitem", "name": "Can change invoice item", "content_type": 111}}, {"pk": 336, "model": "auth.permission", "fields": {"codename": "delete_invoiceitem", "name": "Can delete invoice item", "content_type": 111}}, {"pk": 331, "model": "auth.permission", "fields": {"codename": "add_invoicetransaction", "name": "Can add invoice transaction", "content_type": 110}}, {"pk": 332, "model": "auth.permission", "fields": {"codename": "change_invoicetransaction", "name": "Can change invoice transaction", "content_type": 110}}, {"pk": 333, "model": "auth.permission", "fields": {"codename": "delete_invoicetransaction", "name": "Can delete invoice transaction", "content_type": 110}}, {"pk": 322, "model": "auth.permission", "fields": {"codename": "add_order", "name": "Can add order", "content_type": 107}}, {"pk": 323, "model": "auth.permission", "fields": {"codename": "change_order", "name": "Can change order", "content_type": 107}}, {"pk": 324, "model": "auth.permission", "fields": {"codename": "delete_order", "name": "Can delete order", "content_type": 107}}, {"pk": 325, "model": "auth.permission", "fields": {"codename": "add_orderitem", "name": "Can add order item", "content_type": 108}}, {"pk": 326, "model": "auth.permission", "fields": {"codename": "change_orderitem", "name": "Can change order item", "content_type": 108}}, {"pk": 327, "model": "auth.permission", "fields": {"codename": "delete_orderitem", "name": "Can delete order item", "content_type": 108}}, {"pk": 355, "model": "auth.permission", "fields": {"codename": "add_paidcourseregistration", "name": "Can add paid course registration", "content_type": 118}}, {"pk": 356, "model": "auth.permission", "fields": {"codename": "change_paidcourseregistration", "name": "Can change paid course registration", "content_type": 118}}, {"pk": 357, "model": "auth.permission", "fields": {"codename": "delete_paidcourseregistration", "name": "Can delete paid course registration", "content_type": 118}}, {"pk": 364, "model": "auth.permission", "fields": {"codename": "add_paidcourseregistrationannotation", "name": "Can add paid course registration annotation", "content_type": 121}}, {"pk": 365, "model": "auth.permission", "fields": {"codename": "change_paidcourseregistrationannotation", "name": "Can change paid course registration annotation", "content_type": 121}}, {"pk": 366, "model": "auth.permission", "fields": {"codename": "delete_paidcourseregistrationannotation", "name": "Can delete paid course registration annotation", "content_type": 121}}, {"pk": 346, "model": "auth.permission", "fields": {"codename": "add_registrationcoderedemption", "name": "Can add registration code redemption", "content_type": 115}}, {"pk": 347, "model": "auth.permission", "fields": {"codename": "change_registrationcoderedemption", "name": "Can change registration code redemption", "content_type": 115}}, {"pk": 348, "model": "auth.permission", "fields": {"codename": "delete_registrationcoderedemption", "name": "Can delete registration code redemption", "content_type": 115}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 6}}, {"pk": 43, "model": "auth.permission", "fields": {"codename": "add_migrationhistory", "name": "Can add migration history", "content_type": 15}}, {"pk": 44, "model": "auth.permission", "fields": {"codename": "change_migrationhistory", "name": "Can change migration history", "content_type": 15}}, {"pk": 45, "model": "auth.permission", "fields": {"codename": "delete_migrationhistory", "name": "Can delete migration history", "content_type": 15}}, {"pk": 304, "model": "auth.permission", "fields": {"codename": "add_splashconfig", "name": "Can add splash config", "content_type": 101}}, {"pk": 305, "model": "auth.permission", "fields": {"codename": "change_splashconfig", "name": "Can change splash config", "content_type": 101}}, {"pk": 306, "model": "auth.permission", "fields": {"codename": "delete_splashconfig", "name": "Can delete splash config", "content_type": 101}}, {"pk": 103, "model": "auth.permission", "fields": {"codename": "add_anonymoususerid", "name": "Can add anonymous user id", "content_type": 35}}, {"pk": 104, "model": "auth.permission", "fields": {"codename": "change_anonymoususerid", "name": "Can change anonymous user id", "content_type": 35}}, {"pk": 105, "model": "auth.permission", "fields": {"codename": "delete_anonymoususerid", "name": "Can delete anonymous user id", "content_type": 35}}, {"pk": 142, "model": "auth.permission", "fields": {"codename": "add_courseaccessrole", "name": "Can add course access role", "content_type": 48}}, {"pk": 143, "model": "auth.permission", "fields": {"codename": "change_courseaccessrole", "name": "Can change course access role", "content_type": 48}}, {"pk": 144, "model": "auth.permission", "fields": {"codename": "delete_courseaccessrole", "name": "Can delete course access role", "content_type": 48}}, {"pk": 133, "model": "auth.permission", "fields": {"codename": "add_courseenrollment", "name": "Can add course enrollment", "content_type": 45}}, {"pk": 134, "model": "auth.permission", "fields": {"codename": "change_courseenrollment", "name": "Can change course enrollment", "content_type": 45}}, {"pk": 135, "model": "auth.permission", "fields": {"codename": "delete_courseenrollment", "name": "Can delete course enrollment", "content_type": 45}}, {"pk": 139, "model": "auth.permission", "fields": {"codename": "add_courseenrollmentallowed", "name": "Can add course enrollment allowed", "content_type": 47}}, {"pk": 140, "model": "auth.permission", "fields": {"codename": "change_courseenrollmentallowed", "name": "Can change course enrollment allowed", "content_type": 47}}, {"pk": 141, "model": "auth.permission", "fields": {"codename": "delete_courseenrollmentallowed", "name": "Can delete course enrollment allowed", "content_type": 47}}, {"pk": 157, "model": "auth.permission", "fields": {"codename": "add_courseenrollmentattribute", "name": "Can add course enrollment attribute", "content_type": 53}}, {"pk": 158, "model": "auth.permission", "fields": {"codename": "change_courseenrollmentattribute", "name": "Can change course enrollment attribute", "content_type": 53}}, {"pk": 159, "model": "auth.permission", "fields": {"codename": "delete_courseenrollmentattribute", "name": "Can delete course enrollment attribute", "content_type": 53}}, {"pk": 145, "model": "auth.permission", "fields": {"codename": "add_dashboardconfiguration", "name": "Can add dashboard configuration", "content_type": 49}}, {"pk": 146, "model": "auth.permission", "fields": {"codename": "change_dashboardconfiguration", "name": "Can change dashboard configuration", "content_type": 49}}, {"pk": 147, "model": "auth.permission", "fields": {"codename": "delete_dashboardconfiguration", "name": "Can delete dashboard configuration", "content_type": 49}}, {"pk": 151, "model": "auth.permission", "fields": {"codename": "add_entranceexamconfiguration", "name": "Can add entrance exam configuration", "content_type": 51}}, {"pk": 152, "model": "auth.permission", "fields": {"codename": "change_entranceexamconfiguration", "name": "Can change entrance exam configuration", "content_type": 51}}, {"pk": 153, "model": "auth.permission", "fields": {"codename": "delete_entranceexamconfiguration", "name": "Can delete entrance exam configuration", "content_type": 51}}, {"pk": 154, "model": "auth.permission", "fields": {"codename": "add_languageproficiency", "name": "Can add language proficiency", "content_type": 52}}, {"pk": 155, "model": "auth.permission", "fields": {"codename": "change_languageproficiency", "name": "Can change language proficiency", "content_type": 52}}, {"pk": 156, "model": "auth.permission", "fields": {"codename": "delete_languageproficiency", "name": "Can delete language proficiency", "content_type": 52}}, {"pk": 148, "model": "auth.permission", "fields": {"codename": "add_linkedinaddtoprofileconfiguration", "name": "Can add linked in add to profile configuration", "content_type": 50}}, {"pk": 149, "model": "auth.permission", "fields": {"codename": "change_linkedinaddtoprofileconfiguration", "name": "Can change linked in add to profile configuration", "content_type": 50}}, {"pk": 150, "model": "auth.permission", "fields": {"codename": "delete_linkedinaddtoprofileconfiguration", "name": "Can delete linked in add to profile configuration", "content_type": 50}}, {"pk": 130, "model": "auth.permission", "fields": {"codename": "add_loginfailures", "name": "Can add login failures", "content_type": 44}}, {"pk": 131, "model": "auth.permission", "fields": {"codename": "change_loginfailures", "name": "Can change login failures", "content_type": 44}}, {"pk": 132, "model": "auth.permission", "fields": {"codename": "delete_loginfailures", "name": "Can delete login failures", "content_type": 44}}, {"pk": 136, "model": "auth.permission", "fields": {"codename": "add_manualenrollmentaudit", "name": "Can add manual enrollment audit", "content_type": 46}}, {"pk": 137, "model": "auth.permission", "fields": {"codename": "change_manualenrollmentaudit", "name": "Can change manual enrollment audit", "content_type": 46}}, {"pk": 138, "model": "auth.permission", "fields": {"codename": "delete_manualenrollmentaudit", "name": "Can delete manual enrollment audit", "content_type": 46}}, {"pk": 127, "model": "auth.permission", "fields": {"codename": "add_passwordhistory", "name": "Can add password history", "content_type": 43}}, {"pk": 128, "model": "auth.permission", "fields": {"codename": "change_passwordhistory", "name": "Can change password history", "content_type": 43}}, {"pk": 129, "model": "auth.permission", "fields": {"codename": "delete_passwordhistory", "name": "Can delete password history", "content_type": 43}}, {"pk": 124, "model": "auth.permission", "fields": {"codename": "add_pendingemailchange", "name": "Can add pending email change", "content_type": 42}}, {"pk": 125, "model": "auth.permission", "fields": {"codename": "change_pendingemailchange", "name": "Can change pending email change", "content_type": 42}}, {"pk": 126, "model": "auth.permission", "fields": {"codename": "delete_pendingemailchange", "name": "Can delete pending email change", "content_type": 42}}, {"pk": 121, "model": "auth.permission", "fields": {"codename": "add_pendingnamechange", "name": "Can add pending name change", "content_type": 41}}, {"pk": 122, "model": "auth.permission", "fields": {"codename": "change_pendingnamechange", "name": "Can change pending name change", "content_type": 41}}, {"pk": 123, "model": "auth.permission", "fields": {"codename": "delete_pendingnamechange", "name": "Can delete pending name change", "content_type": 41}}, {"pk": 118, "model": "auth.permission", "fields": {"codename": "add_registration", "name": "Can add registration", "content_type": 40}}, {"pk": 119, "model": "auth.permission", "fields": {"codename": "change_registration", "name": "Can change registration", "content_type": 40}}, {"pk": 120, "model": "auth.permission", "fields": {"codename": "delete_registration", "name": "Can delete registration", "content_type": 40}}, {"pk": 109, "model": "auth.permission", "fields": {"codename": "add_userprofile", "name": "Can add user profile", "content_type": 37}}, {"pk": 110, "model": "auth.permission", "fields": {"codename": "change_userprofile", "name": "Can change user profile", "content_type": 37}}, {"pk": 111, "model": "auth.permission", "fields": {"codename": "delete_userprofile", "name": "Can delete user profile", "content_type": 37}}, {"pk": 112, "model": "auth.permission", "fields": {"codename": "add_usersignupsource", "name": "Can add user signup source", "content_type": 38}}, {"pk": 113, "model": "auth.permission", "fields": {"codename": "change_usersignupsource", "name": "Can change user signup source", "content_type": 38}}, {"pk": 114, "model": "auth.permission", "fields": {"codename": "delete_usersignupsource", "name": "Can delete user signup source", "content_type": 38}}, {"pk": 106, "model": "auth.permission", "fields": {"codename": "add_userstanding", "name": "Can add user standing", "content_type": 36}}, {"pk": 107, "model": "auth.permission", "fields": {"codename": "change_userstanding", "name": "Can change user standing", "content_type": 36}}, {"pk": 108, "model": "auth.permission", "fields": {"codename": "delete_userstanding", "name": "Can delete user standing", "content_type": 36}}, {"pk": 115, "model": "auth.permission", "fields": {"codename": "add_usertestgroup", "name": "Can add user test group", "content_type": 39}}, {"pk": 116, "model": "auth.permission", "fields": {"codename": "change_usertestgroup", "name": "Can change user test group", "content_type": 39}}, {"pk": 117, "model": "auth.permission", "fields": {"codename": "delete_usertestgroup", "name": "Can delete user test group", "content_type": 39}}, {"pk": 448, "model": "auth.permission", "fields": {"codename": "add_score", "name": "Can add score", "content_type": 149}}, {"pk": 449, "model": "auth.permission", "fields": {"codename": "change_score", "name": "Can change score", "content_type": 149}}, {"pk": 450, "model": "auth.permission", "fields": {"codename": "delete_score", "name": "Can delete score", "content_type": 149}}, {"pk": 451, "model": "auth.permission", "fields": {"codename": "add_scoresummary", "name": "Can add score summary", "content_type": 150}}, {"pk": 452, "model": "auth.permission", "fields": {"codename": "change_scoresummary", "name": "Can change score summary", "content_type": 150}}, {"pk": 453, "model": "auth.permission", "fields": {"codename": "delete_scoresummary", "name": "Can delete score summary", "content_type": 150}}, {"pk": 442, "model": "auth.permission", "fields": {"codename": "add_studentitem", "name": "Can add student item", "content_type": 147}}, {"pk": 443, "model": "auth.permission", "fields": {"codename": "change_studentitem", "name": "Can change student item", "content_type": 147}}, {"pk": 444, "model": "auth.permission", "fields": {"codename": "delete_studentitem", "name": "Can delete student item", "content_type": 147}}, {"pk": 445, "model": "auth.permission", "fields": {"codename": "add_submission", "name": "Can add submission", "content_type": 148}}, {"pk": 446, "model": "auth.permission", "fields": {"codename": "change_submission", "name": "Can change submission", "content_type": 148}}, {"pk": 447, "model": "auth.permission", "fields": {"codename": "delete_submission", "name": "Can delete submission", "content_type": 148}}, {"pk": 430, "model": "auth.permission", "fields": {"codename": "add_surveyanswer", "name": "Can add survey answer", "content_type": 143}}, {"pk": 431, "model": "auth.permission", "fields": {"codename": "change_surveyanswer", "name": "Can change survey answer", "content_type": 143}}, {"pk": 432, "model": "auth.permission", "fields": {"codename": "delete_surveyanswer", "name": "Can delete survey answer", "content_type": 143}}, {"pk": 427, "model": "auth.permission", "fields": {"codename": "add_surveyform", "name": "Can add survey form", "content_type": 142}}, {"pk": 428, "model": "auth.permission", "fields": {"codename": "change_surveyform", "name": "Can change survey form", "content_type": 142}}, {"pk": 429, "model": "auth.permission", "fields": {"codename": "delete_surveyform", "name": "Can delete survey form", "content_type": 142}}, {"pk": 316, "model": "auth.permission", "fields": {"codename": "add_courseteam", "name": "Can add course team", "content_type": 105}}, {"pk": 317, "model": "auth.permission", "fields": {"codename": "change_courseteam", "name": "Can change course team", "content_type": 105}}, {"pk": 318, "model": "auth.permission", "fields": {"codename": "delete_courseteam", "name": "Can delete course team", "content_type": 105}}, {"pk": 319, "model": "auth.permission", "fields": {"codename": "add_courseteammembership", "name": "Can add course team membership", "content_type": 106}}, {"pk": 320, "model": "auth.permission", "fields": {"codename": "change_courseteammembership", "name": "Can change course team membership", "content_type": 106}}, {"pk": 321, "model": "auth.permission", "fields": {"codename": "delete_courseteammembership", "name": "Can delete course team membership", "content_type": 106}}, {"pk": 160, "model": "auth.permission", "fields": {"codename": "add_trackinglog", "name": "Can add tracking log", "content_type": 54}}, {"pk": 161, "model": "auth.permission", "fields": {"codename": "change_trackinglog", "name": "Can change tracking log", "content_type": 54}}, {"pk": 162, "model": "auth.permission", "fields": {"codename": "delete_trackinglog", "name": "Can delete tracking log", "content_type": 54}}, {"pk": 310, "model": "auth.permission", "fields": {"codename": "add_usercoursetag", "name": "Can add user course tag", "content_type": 103}}, {"pk": 311, "model": "auth.permission", "fields": {"codename": "change_usercoursetag", "name": "Can change user course tag", "content_type": 103}}, {"pk": 312, "model": "auth.permission", "fields": {"codename": "delete_usercoursetag", "name": "Can delete user course tag", "content_type": 103}}, {"pk": 313, "model": "auth.permission", "fields": {"codename": "add_userorgtag", "name": "Can add user org tag", "content_type": 104}}, {"pk": 314, "model": "auth.permission", "fields": {"codename": "change_userorgtag", "name": "Can change user org tag", "content_type": 104}}, {"pk": 315, "model": "auth.permission", "fields": {"codename": "delete_userorgtag", "name": "Can delete user org tag", "content_type": 104}}, {"pk": 307, "model": "auth.permission", "fields": {"codename": "add_userpreference", "name": "Can add user preference", "content_type": 102}}, {"pk": 308, "model": "auth.permission", "fields": {"codename": "change_userpreference", "name": "Can change user preference", "content_type": 102}}, {"pk": 309, "model": "auth.permission", "fields": {"codename": "delete_userpreference", "name": "Can delete user preference", "content_type": 102}}, {"pk": 163, "model": "auth.permission", "fields": {"codename": "add_ratelimitconfiguration", "name": "Can add rate limit configuration", "content_type": 55}}, {"pk": 164, "model": "auth.permission", "fields": {"codename": "change_ratelimitconfiguration", "name": "Can change rate limit configuration", "content_type": 55}}, {"pk": 165, "model": "auth.permission", "fields": {"codename": "delete_ratelimitconfiguration", "name": "Can delete rate limit configuration", "content_type": 55}}, {"pk": 391, "model": "auth.permission", "fields": {"codename": "add_incoursereverificationconfiguration", "name": "Can add in course reverification configuration", "content_type": 130}}, {"pk": 392, "model": "auth.permission", "fields": {"codename": "change_incoursereverificationconfiguration", "name": "Can change in course reverification configuration", "content_type": 130}}, {"pk": 393, "model": "auth.permission", "fields": {"codename": "delete_incoursereverificationconfiguration", "name": "Can delete in course reverification configuration", "content_type": 130}}, {"pk": 394, "model": "auth.permission", "fields": {"codename": "add_skippedreverification", "name": "Can add skipped reverification", "content_type": 131}}, {"pk": 395, "model": "auth.permission", "fields": {"codename": "change_skippedreverification", "name": "Can change skipped reverification", "content_type": 131}}, {"pk": 396, "model": "auth.permission", "fields": {"codename": "delete_skippedreverification", "name": "Can delete skipped reverification", "content_type": 131}}, {"pk": 382, "model": "auth.permission", "fields": {"codename": "add_softwaresecurephotoverification", "name": "Can add software secure photo verification", "content_type": 127}}, {"pk": 383, "model": "auth.permission", "fields": {"codename": "change_softwaresecurephotoverification", "name": "Can change software secure photo verification", "content_type": 127}}, {"pk": 384, "model": "auth.permission", "fields": {"codename": "delete_softwaresecurephotoverification", "name": "Can delete software secure photo verification", "content_type": 127}}, {"pk": 385, "model": "auth.permission", "fields": {"codename": "add_verificationcheckpoint", "name": "Can add verification checkpoint", "content_type": 128}}, {"pk": 386, "model": "auth.permission", "fields": {"codename": "change_verificationcheckpoint", "name": "Can change verification checkpoint", "content_type": 128}}, {"pk": 387, "model": "auth.permission", "fields": {"codename": "delete_verificationcheckpoint", "name": "Can delete verification checkpoint", "content_type": 128}}, {"pk": 388, "model": "auth.permission", "fields": {"codename": "add_verificationstatus", "name": "Can add Verification Status", "content_type": 129}}, {"pk": 389, "model": "auth.permission", "fields": {"codename": "change_verificationstatus", "name": "Can change Verification Status", "content_type": 129}}, {"pk": 390, "model": "auth.permission", "fields": {"codename": "delete_verificationstatus", "name": "Can delete Verification Status", "content_type": 129}}, {"pk": 250, "model": "auth.permission", "fields": {"codename": "add_article", "name": "Can add article", "content_type": 84}}, {"pk": 254, "model": "auth.permission", "fields": {"codename": "assign", "name": "Can change ownership of any article", "content_type": 84}}, {"pk": 251, "model": "auth.permission", "fields": {"codename": "change_article", "name": "Can change article", "content_type": 84}}, {"pk": 252, "model": "auth.permission", "fields": {"codename": "delete_article", "name": "Can delete article", "content_type": 84}}, {"pk": 255, "model": "auth.permission", "fields": {"codename": "grant", "name": "Can assign permissions to other users", "content_type": 84}}, {"pk": 253, "model": "auth.permission", "fields": {"codename": "moderate", "name": "Can edit all articles and lock/unlock/restore", "content_type": 84}}, {"pk": 256, "model": "auth.permission", "fields": {"codename": "add_articleforobject", "name": "Can add Article for object", "content_type": 85}}, {"pk": 257, "model": "auth.permission", "fields": {"codename": "change_articleforobject", "name": "Can change Article for object", "content_type": 85}}, {"pk": 258, "model": "auth.permission", "fields": {"codename": "delete_articleforobject", "name": "Can delete Article for object", "content_type": 85}}, {"pk": 265, "model": "auth.permission", "fields": {"codename": "add_articleplugin", "name": "Can add article plugin", "content_type": 88}}, {"pk": 266, "model": "auth.permission", "fields": {"codename": "change_articleplugin", "name": "Can change article plugin", "content_type": 88}}, {"pk": 267, "model": "auth.permission", "fields": {"codename": "delete_articleplugin", "name": "Can delete article plugin", "content_type": 88}}, {"pk": 259, "model": "auth.permission", "fields": {"codename": "add_articlerevision", "name": "Can add article revision", "content_type": 86}}, {"pk": 260, "model": "auth.permission", "fields": {"codename": "change_articlerevision", "name": "Can change article revision", "content_type": 86}}, {"pk": 261, "model": "auth.permission", "fields": {"codename": "delete_articlerevision", "name": "Can delete article revision", "content_type": 86}}, {"pk": 280, "model": "auth.permission", "fields": {"codename": "add_articlesubscription", "name": "Can add article subscription", "content_type": 93}}, {"pk": 281, "model": "auth.permission", "fields": {"codename": "change_articlesubscription", "name": "Can change article subscription", "content_type": 93}}, {"pk": 282, "model": "auth.permission", "fields": {"codename": "delete_articlesubscription", "name": "Can delete article subscription", "content_type": 93}}, {"pk": 268, "model": "auth.permission", "fields": {"codename": "add_reusableplugin", "name": "Can add reusable plugin", "content_type": 89}}, {"pk": 269, "model": "auth.permission", "fields": {"codename": "change_reusableplugin", "name": "Can change reusable plugin", "content_type": 89}}, {"pk": 270, "model": "auth.permission", "fields": {"codename": "delete_reusableplugin", "name": "Can delete reusable plugin", "content_type": 89}}, {"pk": 274, "model": "auth.permission", "fields": {"codename": "add_revisionplugin", "name": "Can add revision plugin", "content_type": 91}}, {"pk": 275, "model": "auth.permission", "fields": {"codename": "change_revisionplugin", "name": "Can change revision plugin", "content_type": 91}}, {"pk": 276, "model": "auth.permission", "fields": {"codename": "delete_revisionplugin", "name": "Can delete revision plugin", "content_type": 91}}, {"pk": 277, "model": "auth.permission", "fields": {"codename": "add_revisionpluginrevision", "name": "Can add revision plugin revision", "content_type": 92}}, {"pk": 278, "model": "auth.permission", "fields": {"codename": "change_revisionpluginrevision", "name": "Can change revision plugin revision", "content_type": 92}}, {"pk": 279, "model": "auth.permission", "fields": {"codename": "delete_revisionpluginrevision", "name": "Can delete revision plugin revision", "content_type": 92}}, {"pk": 271, "model": "auth.permission", "fields": {"codename": "add_simpleplugin", "name": "Can add simple plugin", "content_type": 90}}, {"pk": 272, "model": "auth.permission", "fields": {"codename": "change_simpleplugin", "name": "Can change simple plugin", "content_type": 90}}, {"pk": 273, "model": "auth.permission", "fields": {"codename": "delete_simpleplugin", "name": "Can delete simple plugin", "content_type": 90}}, {"pk": 262, "model": "auth.permission", "fields": {"codename": "add_urlpath", "name": "Can add URL path", "content_type": 87}}, {"pk": 263, "model": "auth.permission", "fields": {"codename": "change_urlpath", "name": "Can change URL path", "content_type": 87}}, {"pk": 264, "model": "auth.permission", "fields": {"codename": "delete_urlpath", "name": "Can delete URL path", "content_type": 87}}, {"pk": 502, "model": "auth.permission", "fields": {"codename": "add_assessmentworkflow", "name": "Can add assessment workflow", "content_type": 167}}, {"pk": 503, "model": "auth.permission", "fields": {"codename": "change_assessmentworkflow", "name": "Can change assessment workflow", "content_type": 167}}, {"pk": 504, "model": "auth.permission", "fields": {"codename": "delete_assessmentworkflow", "name": "Can delete assessment workflow", "content_type": 167}}, {"pk": 508, "model": "auth.permission", "fields": {"codename": "add_assessmentworkflowcancellation", "name": "Can add assessment workflow cancellation", "content_type": 169}}, {"pk": 509, "model": "auth.permission", "fields": {"codename": "change_assessmentworkflowcancellation", "name": "Can change assessment workflow cancellation", "content_type": 169}}, {"pk": 510, "model": "auth.permission", "fields": {"codename": "delete_assessmentworkflowcancellation", "name": "Can delete assessment workflow cancellation", "content_type": 169}}, {"pk": 505, "model": "auth.permission", "fields": {"codename": "add_assessmentworkflowstep", "name": "Can add assessment workflow step", "content_type": 168}}, {"pk": 506, "model": "auth.permission", "fields": {"codename": "change_assessmentworkflowstep", "name": "Can change assessment workflow step", "content_type": 168}}, {"pk": 507, "model": "auth.permission", "fields": {"codename": "delete_assessmentworkflowstep", "name": "Can delete assessment workflow step", "content_type": 168}}, {"pk": 571, "model": "auth.permission", "fields": {"codename": "add_studioconfig", "name": "Can add studio config", "content_type": 190}}, {"pk": 572, "model": "auth.permission", "fields": {"codename": "change_studioconfig", "name": "Can change studio config", "content_type": 190}}, {"pk": 573, "model": "auth.permission", "fields": {"codename": "delete_studioconfig", "name": "Can delete studio config", "content_type": 190}}, {"pk": 1, "model": "util.ratelimitconfiguration", "fields": {"change_date": "2015-06-17T19:56:01Z", "changed_by": null, "enabled": true}}, {"pk": 1, "model": "certificates.certificatehtmlviewconfiguration", "fields": {"change_date": "2015-06-17T19:56:03Z", "changed_by": null, "configuration": "{\"default\": {\"accomplishment_class_append\": \"accomplishment-certificate\", \"platform_name\": \"Your Platform Name Here\", \"logo_src\": \"/static/certificates/images/logo.png\", \"logo_url\": \"http://www.example.com\", \"company_verified_certificate_url\": \"http://www.example.com/verified-certificate\", \"company_privacy_url\": \"http://www.example.com/privacy-policy\", \"company_tos_url\": \"http://www.example.com/terms-service\", \"company_about_url\": \"http://www.example.com/about-us\"}, \"base\": {\"certificate_type\": \"base\", \"certificate_title\": \"Certificate of Achievement\", \"document_body_class_append\": \"is-base\"}, \"distinguished\": {\"certificate_type\": \"distinguished\", \"certificate_title\": \"Distinguished Certificate of Achievement\", \"document_body_class_append\": \"is-distinguished\"}}", "enabled": false}}, {"pk": 1, "model": "dark_lang.darklangconfig", "fields": {"change_date": "2015-06-17T19:56:25Z", "changed_by": null, "enabled": true, "released_languages": ""}}, {"pk": 1, "model": "mobile_api.mobileapiconfig", "fields": {"change_date": "2015-06-17T19:56:28Z", "video_profiles": "mobile_low,mobile_high,youtube", "changed_by": null, "enabled": false}}] \ No newline at end of file diff --git a/common/test/db_cache/bok_choy_schema.sql b/common/test/db_cache/bok_choy_schema.sql deleted file mode 100644 index bbba6a4aed..0000000000 --- a/common/test/db_cache/bok_choy_schema.sql +++ /dev/null @@ -1,3433 +0,0 @@ - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `assessment_aiclassifier`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_aiclassifier` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `classifier_set_id` int(11) NOT NULL, - `criterion_id` int(11) NOT NULL, - `classifier_data` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_aiclassifier_714175dc` (`classifier_set_id`), - KEY `assessment_aiclassifier_a36470e4` (`criterion_id`), - CONSTRAINT `classifier_set_id_refs_id_f80cbf6` FOREIGN KEY (`classifier_set_id`) REFERENCES `assessment_aiclassifierset` (`id`), - CONSTRAINT `criterion_id_refs_id_e6ab97f2` FOREIGN KEY (`criterion_id`) REFERENCES `assessment_criterion` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_aiclassifierset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_aiclassifierset` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `rubric_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - `algorithm_id` varchar(128) NOT NULL, - `course_id` varchar(40) NOT NULL, - `item_id` varchar(128) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_aiclassifierset_27cb9807` (`rubric_id`), - KEY `assessment_aiclassifierset_3b1c9c31` (`created_at`), - KEY `assessment_aiclassifierset_53012c1e` (`algorithm_id`), - KEY `assessment_aiclassifierset_ff48d8e5` (`course_id`), - KEY `assessment_aiclassifierset_67b70d25` (`item_id`), - CONSTRAINT `rubric_id_refs_id_c037b8e4` FOREIGN KEY (`rubric_id`) REFERENCES `assessment_rubric` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_aigradingworkflow`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_aigradingworkflow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uuid` varchar(36) NOT NULL, - `scheduled_at` datetime NOT NULL, - `completed_at` datetime DEFAULT NULL, - `submission_uuid` varchar(128) NOT NULL, - `classifier_set_id` int(11) DEFAULT NULL, - `algorithm_id` varchar(128) NOT NULL, - `rubric_id` int(11) NOT NULL, - `assessment_id` int(11) DEFAULT NULL, - `student_id` varchar(40) NOT NULL, - `item_id` varchar(128) NOT NULL, - `course_id` varchar(40) NOT NULL, - `essay_text` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_aigradingworkflow_uuid_492e936265ecbfd2_uniq` (`uuid`), - KEY `assessment_aigradingworkflow_2bbc74ae` (`uuid`), - KEY `assessment_aigradingworkflow_4bacaa90` (`scheduled_at`), - KEY `assessment_aigradingworkflow_a2fd3af6` (`completed_at`), - KEY `assessment_aigradingworkflow_39d020e6` (`submission_uuid`), - KEY `assessment_aigradingworkflow_714175dc` (`classifier_set_id`), - KEY `assessment_aigradingworkflow_53012c1e` (`algorithm_id`), - KEY `assessment_aigradingworkflow_27cb9807` (`rubric_id`), - KEY `assessment_aigradingworkflow_c168f2dc` (`assessment_id`), - KEY `assessment_aigradingworkflow_42ff452e` (`student_id`), - KEY `assessment_aigradingworkflow_67b70d25` (`item_id`), - KEY `assessment_aigradingworkflow_ff48d8e5` (`course_id`), - CONSTRAINT `assessment_id_refs_id_1d8478e7` FOREIGN KEY (`assessment_id`) REFERENCES `assessment_assessment` (`id`), - CONSTRAINT `classifier_set_id_refs_id_1e9046d1` FOREIGN KEY (`classifier_set_id`) REFERENCES `assessment_aiclassifierset` (`id`), - CONSTRAINT `rubric_id_refs_id_dc2a0464` FOREIGN KEY (`rubric_id`) REFERENCES `assessment_rubric` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_aitrainingworkflow`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_aitrainingworkflow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uuid` varchar(36) NOT NULL, - `algorithm_id` varchar(128) NOT NULL, - `classifier_set_id` int(11) DEFAULT NULL, - `scheduled_at` datetime NOT NULL, - `completed_at` datetime DEFAULT NULL, - `item_id` varchar(128) NOT NULL, - `course_id` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_aitrainingworkflow_uuid_284fdaa93019f8ef_uniq` (`uuid`), - KEY `assessment_aitrainingworkflow_2bbc74ae` (`uuid`), - KEY `assessment_aitrainingworkflow_53012c1e` (`algorithm_id`), - KEY `assessment_aitrainingworkflow_714175dc` (`classifier_set_id`), - KEY `assessment_aitrainingworkflow_4bacaa90` (`scheduled_at`), - KEY `assessment_aitrainingworkflow_a2fd3af6` (`completed_at`), - KEY `assessment_aitrainingworkflow_67b70d25` (`item_id`), - KEY `assessment_aitrainingworkflow_ff48d8e5` (`course_id`), - CONSTRAINT `classifier_set_id_refs_id_dcc7412` FOREIGN KEY (`classifier_set_id`) REFERENCES `assessment_aiclassifierset` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_aitrainingworkflow_training_examples`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_aitrainingworkflow_training_examples` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `aitrainingworkflow_id` int(11) NOT NULL, - `trainingexample_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_aitraini_aitrainingworkflow_id_4b50cfbece05470a_uniq` (`aitrainingworkflow_id`,`trainingexample_id`), - KEY `assessment_aitrainingworkflow_training_examples_a57f9195` (`aitrainingworkflow_id`), - KEY `assessment_aitrainingworkflow_training_examples_ea4da31f` (`trainingexample_id`), - CONSTRAINT `aitrainingworkflow_id_refs_id_45c30582` FOREIGN KEY (`aitrainingworkflow_id`) REFERENCES `assessment_aitrainingworkflow` (`id`), - CONSTRAINT `trainingexample_id_refs_id_bf13a24` FOREIGN KEY (`trainingexample_id`) REFERENCES `assessment_trainingexample` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessment` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `submission_uuid` varchar(128) NOT NULL, - `rubric_id` int(11) NOT NULL, - `scored_at` datetime NOT NULL, - `scorer_id` varchar(40) NOT NULL, - `score_type` varchar(2) NOT NULL, - `feedback` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_assessment_39d020e6` (`submission_uuid`), - KEY `assessment_assessment_27cb9807` (`rubric_id`), - KEY `assessment_assessment_3227200` (`scored_at`), - KEY `assessment_assessment_9f54855a` (`scorer_id`), - CONSTRAINT `rubric_id_refs_id_1ab6dbc4` FOREIGN KEY (`rubric_id`) REFERENCES `assessment_rubric` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessmentfeedback`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessmentfeedback` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `submission_uuid` varchar(128) NOT NULL, - `feedback_text` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `submission_uuid` (`submission_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessmentfeedback_assessments`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessmentfeedback_assessments` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `assessmentfeedback_id` int(11) NOT NULL, - `assessment_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_assessmen_assessmentfeedback_id_36925aaa1a839ac_uniq` (`assessmentfeedback_id`,`assessment_id`), - KEY `assessment_assessmentfeedback_assessments_58f1f0d` (`assessmentfeedback_id`), - KEY `assessment_assessmentfeedback_assessments_c168f2dc` (`assessment_id`), - CONSTRAINT `assessment_id_refs_id_e7fd607e` FOREIGN KEY (`assessment_id`) REFERENCES `assessment_assessment` (`id`), - CONSTRAINT `assessmentfeedback_id_refs_id_91bbd347` FOREIGN KEY (`assessmentfeedback_id`) REFERENCES `assessment_assessmentfeedback` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessmentfeedback_options`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessmentfeedback_options` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `assessmentfeedback_id` int(11) NOT NULL, - `assessmentfeedbackoption_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_assessmen_assessmentfeedback_id_14efc9eea8f4c83_uniq` (`assessmentfeedback_id`,`assessmentfeedbackoption_id`), - KEY `assessment_assessmentfeedback_options_58f1f0d` (`assessmentfeedback_id`), - KEY `assessment_assessmentfeedback_options_4e523d64` (`assessmentfeedbackoption_id`), - CONSTRAINT `assessmentfeedback_id_refs_id_5c27c412` FOREIGN KEY (`assessmentfeedback_id`) REFERENCES `assessment_assessmentfeedback` (`id`), - CONSTRAINT `assessmentfeedbackoption_id_refs_id_cdf28acd` FOREIGN KEY (`assessmentfeedbackoption_id`) REFERENCES `assessment_assessmentfeedbackoption` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessmentfeedbackoption`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessmentfeedbackoption` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `text` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `text` (`text`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_assessmentpart`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_assessmentpart` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `assessment_id` int(11) NOT NULL, - `option_id` int(11), - `feedback` longtext NOT NULL, - `criterion_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_assessmentpart_c168f2dc` (`assessment_id`), - KEY `assessment_assessmentpart_2f3b0dc9` (`option_id`), - KEY `assessment_assessmentpart_a36470e4` (`criterion_id`), - CONSTRAINT `assessment_id_refs_id_bff26444` FOREIGN KEY (`assessment_id`) REFERENCES `assessment_assessment` (`id`), - CONSTRAINT `criterion_id_refs_id_eeb3dc44` FOREIGN KEY (`criterion_id`) REFERENCES `assessment_criterion` (`id`), - CONSTRAINT `option_id_refs_id_4439dd5` FOREIGN KEY (`option_id`) REFERENCES `assessment_criterionoption` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_criterion`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_criterion` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `rubric_id` int(11) NOT NULL, - `name` varchar(100) NOT NULL, - `order_num` int(10) unsigned NOT NULL, - `prompt` longtext NOT NULL, - `label` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_criterion_27cb9807` (`rubric_id`), - CONSTRAINT `rubric_id_refs_id_f2f4f3c4` FOREIGN KEY (`rubric_id`) REFERENCES `assessment_rubric` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_criterionoption`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_criterionoption` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `criterion_id` int(11) NOT NULL, - `order_num` int(10) unsigned NOT NULL, - `points` int(10) unsigned NOT NULL, - `name` varchar(100) NOT NULL, - `explanation` longtext NOT NULL, - `label` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_criterionoption_a36470e4` (`criterion_id`), - CONSTRAINT `criterion_id_refs_id_d2645232` FOREIGN KEY (`criterion_id`) REFERENCES `assessment_criterion` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_peerworkflow`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_peerworkflow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `student_id` varchar(40) NOT NULL, - `item_id` varchar(128) NOT NULL, - `course_id` varchar(40) NOT NULL, - `submission_uuid` varchar(128) NOT NULL, - `created_at` datetime NOT NULL, - `completed_at` datetime DEFAULT NULL, - `grading_completed_at` datetime, - `cancelled_at` datetime, - PRIMARY KEY (`id`), - UNIQUE KEY `submission_uuid` (`submission_uuid`), - KEY `assessment_peerworkflow_42ff452e` (`student_id`), - KEY `assessment_peerworkflow_67b70d25` (`item_id`), - KEY `assessment_peerworkflow_ff48d8e5` (`course_id`), - KEY `assessment_peerworkflow_3b1c9c31` (`created_at`), - KEY `assessment_peerworkflow_a2fd3af6` (`completed_at`), - KEY `assessment_peerworkflow_course_id_5ca23fddca9b630d` (`course_id`,`item_id`,`student_id`), - KEY `assessment_peerworkflow_dcd62131` (`grading_completed_at`), - KEY `assessment_peerworkflow_853d09a8` (`cancelled_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_peerworkflowitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_peerworkflowitem` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `scorer_id` int(11) NOT NULL, - `author_id` int(11) NOT NULL, - `submission_uuid` varchar(128) NOT NULL, - `started_at` datetime NOT NULL, - `assessment_id` int(11) DEFAULT NULL, - `scored` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `assessment_peerworkflowitem_9f54855a` (`scorer_id`), - KEY `assessment_peerworkflowitem_cc846901` (`author_id`), - KEY `assessment_peerworkflowitem_39d020e6` (`submission_uuid`), - KEY `assessment_peerworkflowitem_d6e710e4` (`started_at`), - KEY `assessment_peerworkflowitem_c168f2dc` (`assessment_id`), - CONSTRAINT `assessment_id_refs_id_f69a86a1` FOREIGN KEY (`assessment_id`) REFERENCES `assessment_assessment` (`id`), - CONSTRAINT `author_id_refs_id_59547df0` FOREIGN KEY (`author_id`) REFERENCES `assessment_peerworkflow` (`id`), - CONSTRAINT `scorer_id_refs_id_59547df0` FOREIGN KEY (`scorer_id`) REFERENCES `assessment_peerworkflow` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_rubric`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_rubric` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `content_hash` varchar(40) NOT NULL, - `structure_hash` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_hash` (`content_hash`), - KEY `assessment_rubric_36e74b05` (`structure_hash`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_studenttrainingworkflow`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_studenttrainingworkflow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `submission_uuid` varchar(128) NOT NULL, - `student_id` varchar(40) NOT NULL, - `item_id` varchar(128) NOT NULL, - `course_id` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_studenttrainin_submission_uuid_6d32c6477719d68f_uniq` (`submission_uuid`), - KEY `assessment_studenttrainingworkflow_39d020e6` (`submission_uuid`), - KEY `assessment_studenttrainingworkflow_42ff452e` (`student_id`), - KEY `assessment_studenttrainingworkflow_67b70d25` (`item_id`), - KEY `assessment_studenttrainingworkflow_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_studenttrainingworkflowitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_studenttrainingworkflowitem` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `workflow_id` int(11) NOT NULL, - `order_num` int(10) unsigned NOT NULL, - `started_at` datetime NOT NULL, - `completed_at` datetime DEFAULT NULL, - `training_example_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_studenttrainingworkf_order_num_1391289faa95b87c_uniq` (`order_num`,`workflow_id`), - KEY `assessment_studenttrainingworkflowitem_26cddbc7` (`workflow_id`), - KEY `assessment_studenttrainingworkflowitem_541d6663` (`training_example_id`), - CONSTRAINT `training_example_id_refs_id_7d3f36e4` FOREIGN KEY (`training_example_id`) REFERENCES `assessment_trainingexample` (`id`), - CONSTRAINT `workflow_id_refs_id_ce50a30` FOREIGN KEY (`workflow_id`) REFERENCES `assessment_studenttrainingworkflow` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_trainingexample`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_trainingexample` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `raw_answer` longtext NOT NULL, - `rubric_id` int(11) NOT NULL, - `content_hash` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_hash` (`content_hash`), - KEY `assessment_trainingexample_27cb9807` (`rubric_id`), - CONSTRAINT `rubric_id_refs_id_7750db21` FOREIGN KEY (`rubric_id`) REFERENCES `assessment_rubric` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `assessment_trainingexample_options_selected`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `assessment_trainingexample_options_selected` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `trainingexample_id` int(11) NOT NULL, - `criterionoption_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `assessment_trainingexa_trainingexample_id_60940991fb17d27d_uniq` (`trainingexample_id`,`criterionoption_id`), - KEY `assessment_trainingexample_options_selected_ea4da31f` (`trainingexample_id`), - KEY `assessment_trainingexample_options_selected_843fa247` (`criterionoption_id`), - CONSTRAINT `criterionoption_id_refs_id_bed5a465` FOREIGN KEY (`criterionoption_id`) REFERENCES `assessment_criterionoption` (`id`), - CONSTRAINT `trainingexample_id_refs_id_5f0faa8d` FOREIGN KEY (`trainingexample_id`) REFERENCES `assessment_trainingexample` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `auth_group`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_group` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(80) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `auth_group_permissions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_group_permissions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `group_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `group_id` (`group_id`,`permission_id`), - KEY `auth_group_permissions_bda51c3c` (`group_id`), - KEY `auth_group_permissions_1e014c8f` (`permission_id`), - CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `permission_id_refs_id_a7792de1` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `auth_permission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_permission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `content_type_id` int(11) NOT NULL, - `codename` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - 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=574 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 */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_registration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `activation_key` varchar(32) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - UNIQUE KEY `activation_key` (`activation_key`), - CONSTRAINT `user_id_refs_id_3e5b0b5` 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 `auth_user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(30) NOT NULL, - `first_name` varchar(30) NOT NULL, - `last_name` varchar(30) NOT NULL, - `email` varchar(75) NOT NULL, - `password` varchar(128) NOT NULL, - `is_staff` tinyint(1) NOT NULL, - `is_active` tinyint(1) NOT NULL, - `is_superuser` tinyint(1) NOT NULL, - `last_login` datetime NOT NULL, - `date_joined` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`), - UNIQUE KEY `email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `auth_user_groups`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_user_groups` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `group_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`group_id`), - KEY `auth_user_groups_fbfc09f1` (`user_id`), - KEY `auth_user_groups_bda51c3c` (`group_id`), - CONSTRAINT `group_id_refs_id_f0ee9890` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `user_id_refs_id_831107f1` 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 `auth_user_user_permissions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_user_user_permissions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`permission_id`), - KEY `auth_user_user_permissions_fbfc09f1` (`user_id`), - KEY `auth_user_user_permissions_1e014c8f` (`permission_id`), - CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), - CONSTRAINT `user_id_refs_id_f2045483` 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 `auth_userprofile`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_userprofile` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - `language` varchar(255) NOT NULL, - `location` varchar(255) NOT NULL, - `meta` longtext NOT NULL, - `courseware` varchar(255) NOT NULL, - `gender` varchar(6), - `mailing_address` longtext, - `year_of_birth` int(11), - `level_of_education` varchar(6), - `goals` longtext, - `allow_certificate` tinyint(1) NOT NULL, - `country` varchar(2), - `city` longtext, - `bio` varchar(3000), - `profile_image_uploaded_at` datetime, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - KEY `auth_userprofile_52094d6e` (`name`), - KEY `auth_userprofile_8a7ac9ab` (`language`), - KEY `auth_userprofile_b54954de` (`location`), - KEY `auth_userprofile_fca3d292` (`gender`), - KEY `auth_userprofile_d85587` (`year_of_birth`), - KEY `auth_userprofile_551e365c` (`level_of_education`), - CONSTRAINT `user_id_refs_id_628b4c11` 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 `branding_brandingapiconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `branding_brandingapiconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `branding_brandingapiconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_9f2ff49` 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 `branding_brandinginfoconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `branding_brandinginfoconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `configuration` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `branding_brandinginfoconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_d2757db8` 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 `bulk_email_courseauthorization`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bulk_email_courseauthorization` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `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 */; -DROP TABLE IF EXISTS `bulk_email_courseemail`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bulk_email_courseemail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `sender_id` int(11) DEFAULT NULL, - `slug` varchar(128) NOT NULL, - `subject` varchar(128) NOT NULL, - `html_message` longtext, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_id` varchar(255) NOT NULL, - `to_option` varchar(64) NOT NULL, - `text_message` longtext, - `template_name` varchar(255), - `from_addr` varchar(255), - PRIMARY KEY (`id`), - KEY `bulk_email_courseemail_901f59e9` (`sender_id`), - KEY `bulk_email_courseemail_36af87d1` (`slug`), - KEY `bulk_email_courseemail_ff48d8e5` (`course_id`), - CONSTRAINT `sender_id_refs_id_70ed6279` FOREIGN KEY (`sender_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bulk_email_courseemailtemplate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bulk_email_courseemailtemplate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `html_template` longtext, - `plain_template` longtext, - `name` varchar(255), - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bulk_email_optout`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bulk_email_optout` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT 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`), - KEY `bulk_email_optout_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_9e68e67c` 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 `celery_taskmeta`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `celery_taskmeta` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `task_id` varchar(255) NOT NULL, - `status` varchar(50) NOT NULL, - `result` longtext, - `date_done` datetime NOT NULL, - `traceback` longtext, - `hidden` tinyint(1) NOT NULL, - `meta` longtext, - PRIMARY KEY (`id`), - UNIQUE KEY `task_id` (`task_id`), - KEY `celery_taskmeta_c91f1bf` (`hidden`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `celery_tasksetmeta`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `celery_tasksetmeta` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `taskset_id` varchar(255) NOT NULL, - `result` longtext NOT NULL, - `date_done` datetime NOT NULL, - `hidden` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `taskset_id` (`taskset_id`), - KEY `celery_tasksetmeta_c91f1bf` (`hidden`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `certificates_badgeassertion`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_badgeassertion` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `mode` varchar(100) NOT NULL, - `data` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `certificates_badgeassertion_course_id_f465e63872f731f_uniq` (`course_id`,`user_id`), - KEY `certificates_badgeassertion_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_30664b3b` 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 `certificates_badgeimageconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_badgeimageconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `mode` varchar(125) NOT NULL, - `icon` varchar(100) NOT NULL, - `default` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `mode` (`mode`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `certificates_certificategenerationconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_certificategenerationconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `certificates_certificategenerationconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_abb3a677` 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 `certificates_certificategenerationcoursesetting`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_certificategenerationcoursesetting` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_key` varchar(255) NOT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `certificates_certificategenerationcoursesetting_b4b47e7a` (`course_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `certificates_certificatehtmlviewconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_certificatehtmlviewconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `configuration` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `certificates_certificatehtmlviewconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_8584db17` 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 `certificates_certificatewhitelist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_certificatewhitelist` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `whitelist` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `certificates_certificatewhitelist_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_a7ba9306` 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 `certificates_examplecertificate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_examplecertificate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `example_cert_set_id` int(11) NOT NULL, - `description` varchar(255) NOT NULL, - `uuid` varchar(255) NOT NULL, - `access_key` varchar(255) NOT NULL, - `full_name` varchar(255) NOT NULL, - `template` varchar(255) NOT NULL, - `status` varchar(255) NOT NULL, - `error_reason` longtext, - `download_url` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `uuid` (`uuid`), - KEY `certificates_examplecertificate_uuid_183b9188451b331e` (`uuid`,`access_key`), - KEY `certificates_examplecertificate_3b9264a` (`example_cert_set_id`), - KEY `certificates_examplecertificate_752852c3` (`access_key`), - CONSTRAINT `example_cert_set_id_refs_id_bdd9e28a` FOREIGN KEY (`example_cert_set_id`) REFERENCES `certificates_examplecertificateset` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `certificates_examplecertificateset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_examplecertificateset` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_key` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `certificates_examplecertificateset_b4b47e7a` (`course_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `certificates_generatedcertificate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `certificates_generatedcertificate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `download_url` varchar(128) NOT NULL, - `grade` varchar(5) NOT NULL, - `course_id` varchar(255) NOT NULL, - `key` varchar(32) NOT NULL, - `distinction` tinyint(1) NOT NULL, - `status` varchar(32) NOT NULL, - `verify_uuid` varchar(32) NOT NULL, - `download_uuid` varchar(32) NOT NULL, - `name` varchar(255) NOT NULL, - `created_date` datetime NOT NULL, - `modified_date` datetime NOT NULL, - `error_reason` varchar(512) NOT NULL, - `mode` varchar(32) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `certificates_generatedcertifica_course_id_1389f6b2d72f5e78_uniq` (`course_id`,`user_id`), - KEY `certificates_generatedcertificate_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_8e23bfe2` 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 `circuit_servercircuit`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `circuit_servercircuit` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(32) NOT NULL, - `schematic` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `contentstore_pushnotificationconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `contentstore_pushnotificationconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `contentstore_pushnotificationconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_e431b975` 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 `contentstore_videouploadconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `contentstore_videouploadconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `profile_whitelist` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `contentstore_videouploadconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_209c438f` 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 `cors_csrf_xdomainproxyconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `cors_csrf_xdomainproxyconfiguration` ( - `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, - PRIMARY KEY (`id`), - KEY `cors_csrf_xdomainproxyconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_3dfcfcb0` 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 `corsheaders_corsmodel`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `corsheaders_corsmodel` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `cors` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_action_state_coursererunstate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_action_state_coursererunstate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created_time` datetime NOT NULL, - `updated_time` datetime NOT NULL, - `created_user_id` int(11) DEFAULT NULL, - `updated_user_id` int(11) DEFAULT NULL, - `course_key` varchar(255) NOT NULL, - `action` varchar(100) NOT NULL, - `state` varchar(50) NOT NULL, - `should_display` tinyint(1) NOT NULL, - `message` varchar(1000) NOT NULL, - `source_course_key` varchar(255) NOT NULL, - `display_name` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_action_state_coursererun_course_key_cf5da77ed3032d6_uniq` (`course_key`,`action`), - KEY `course_action_state_coursererunstate_5b876fa2` (`created_user_id`), - KEY `course_action_state_coursererunstate_ceb2e2e7` (`updated_user_id`), - KEY `course_action_state_coursererunstate_b4b47e7a` (`course_key`), - KEY `course_action_state_coursererunstate_1bd4707b` (`action`), - KEY `course_action_state_coursererunstate_ebfe36dd` (`source_course_key`), - CONSTRAINT `created_user_id_refs_id_1744bdeb` FOREIGN KEY (`created_user_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `updated_user_id_refs_id_1744bdeb` FOREIGN KEY (`updated_user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_creators_coursecreator`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_creators_coursecreator` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `state_changed` datetime NOT NULL, - `state` varchar(24) NOT NULL, - `note` varchar(512) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_6a0e6044` 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 `course_groups_coursecohort`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_groups_coursecohort` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_user_group_id` int(11) NOT NULL, - `assignment_type` varchar(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_user_group_id` (`course_user_group_id`), - CONSTRAINT `course_user_group_id_refs_id_8febc00f` FOREIGN KEY (`course_user_group_id`) REFERENCES `course_groups_courseusergroup` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_groups_coursecohortssettings`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_groups_coursecohortssettings` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `is_cohorted` tinyint(1) NOT NULL, - `course_id` varchar(255) NOT NULL, - `cohorted_discussions` longtext, - `always_cohort_inline_discussions` 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 `course_groups_courseusergroup`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_groups_courseusergroup` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - `group_type` varchar(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_groups_courseusergroup_name_63f7511804c52f38_uniq` (`name`,`course_id`), - KEY `course_groups_courseusergroup_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_groups_courseusergroup_users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_groups_courseusergroup_users` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `courseusergroup_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_groups_courseus_courseusergroup_id_46691806058983eb_uniq` (`courseusergroup_id`,`user_id`), - KEY `course_groups_courseusergroup_users_caee1c64` (`courseusergroup_id`), - KEY `course_groups_courseusergroup_users_fbfc09f1` (`user_id`), - CONSTRAINT `courseusergroup_id_refs_id_d26180aa` FOREIGN KEY (`courseusergroup_id`) REFERENCES `course_groups_courseusergroup` (`id`), - CONSTRAINT `user_id_refs_id_bf33b47a` 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 `course_groups_courseusergrouppartitiongroup`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_groups_courseusergrouppartitiongroup` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_user_group_id` int(11) NOT NULL, - `partition_id` int(11) NOT NULL, - `group_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_user_group_id` (`course_user_group_id`), - CONSTRAINT `course_user_group_id_refs_id_145383c4` FOREIGN KEY (`course_user_group_id`) REFERENCES `course_groups_courseusergroup` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_modes_coursemode`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_modes_coursemode` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `mode_slug` varchar(100) NOT NULL, - `mode_display_name` varchar(255) NOT NULL, - `min_price` int(11) NOT NULL, - `suggested_prices` varchar(255) NOT NULL, - `currency` varchar(8) NOT NULL, - `expiration_date` date DEFAULT NULL, - `expiration_datetime` datetime DEFAULT NULL, - `description` longtext, - `sku` varchar(255), - PRIMARY KEY (`id`), - UNIQUE KEY `course_modes_coursemode_course_id_69505c92fc09856_uniq` (`course_id`,`currency`,`mode_slug`), - KEY `course_modes_coursemode_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_modes_coursemodesarchive`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_modes_coursemodesarchive` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `mode_slug` varchar(100) NOT NULL, - `mode_display_name` varchar(255) NOT NULL, - `min_price` int(11) NOT NULL, - `suggested_prices` varchar(255) NOT NULL, - `currency` varchar(8) NOT NULL, - `expiration_date` date DEFAULT NULL, - `expiration_datetime` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `course_modes_coursemodesarchive_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `course_structures_coursestructure`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `course_structures_coursestructure` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_id` varchar(255) NOT NULL, - `structure_json` longtext, - 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 `courseware_offlinecomputedgrade`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_offlinecomputedgrade` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `created` datetime DEFAULT NULL, - `updated` datetime NOT NULL, - `gradeset` longtext, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_offlinecomputedgrade_user_id_46133bbd0926078f_uniq` (`user_id`,`course_id`), - KEY `courseware_offlinecomputedgrade_fbfc09f1` (`user_id`), - KEY `courseware_offlinecomputedgrade_ff48d8e5` (`course_id`), - KEY `courseware_offlinecomputedgrade_3216ff68` (`created`), - KEY `courseware_offlinecomputedgrade_8aac229` (`updated`), - CONSTRAINT `user_id_refs_id_38cf339d` 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 `courseware_offlinecomputedgradelog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_offlinecomputedgradelog` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `created` datetime DEFAULT NULL, - `seconds` int(11) NOT NULL, - `nstudents` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `courseware_offlinecomputedgradelog_ff48d8e5` (`course_id`), - KEY `courseware_offlinecomputedgradelog_3216ff68` (`created`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_studentfieldoverride`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_studentfieldoverride` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `location` varchar(255) NOT NULL, - `student_id` int(11) NOT NULL, - `field` varchar(255) NOT NULL, - `value` longtext NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_studentfieldoverride_course_id_39dd7eaeac5623d2_uniq` (`course_id`,`field`,`location`,`student_id`), - KEY `courseware_studentfieldoverride_ff48d8e5` (`course_id`), - KEY `courseware_studentfieldoverride_b54954de` (`location`), - KEY `courseware_studentfieldoverride_42ff452e` (`student_id`), - KEY `courseware_studentfieldoverride_course_id_344e77afe4983e04` (`course_id`,`location`,`student_id`), - CONSTRAINT `student_id_refs_id_7b49c12b` FOREIGN KEY (`student_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_studentmodule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_studentmodule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `module_type` varchar(32) NOT NULL, - `module_id` varchar(255) NOT NULL, - `student_id` int(11) NOT NULL, - `state` longtext, - `grade` double DEFAULT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `max_grade` double, - `done` varchar(8) NOT NULL, - `course_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_studentmodule_student_id_635d77aea1256de5_uniq` (`student_id`,`module_id`,`course_id`), - KEY `courseware_studentmodule_42ff452e` (`student_id`), - KEY `courseware_studentmodule_3216ff68` (`created`), - KEY `courseware_studentmodule_6dff86b5` (`grade`), - KEY `courseware_studentmodule_5436e97a` (`modified`), - KEY `courseware_studentmodule_2d8768ff` (`module_type`), - KEY `courseware_studentmodule_f53ed95e` (`module_id`), - KEY `courseware_studentmodule_1923c03f` (`done`), - KEY `courseware_studentmodule_ff48d8e5` (`course_id`), - CONSTRAINT `student_id_refs_id_79ba2570` FOREIGN KEY (`student_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_studentmodulehistory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_studentmodulehistory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `student_module_id` int(11) NOT NULL, - `version` varchar(255), - `created` datetime NOT NULL, - `state` longtext, - `grade` double DEFAULT NULL, - `max_grade` double DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `courseware_studentmodulehistory_5656f5fe` (`student_module_id`), - KEY `courseware_studentmodulehistory_659105e4` (`version`), - KEY `courseware_studentmodulehistory_3216ff68` (`created`), - CONSTRAINT `student_module_id_refs_id_e48636f4` FOREIGN KEY (`student_module_id`) REFERENCES `courseware_studentmodule` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_xmodulestudentinfofield`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_xmodulestudentinfofield` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `field_name` varchar(64) NOT NULL, - `value` longtext NOT NULL, - `student_id` int(11) NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_xmodulestudentinfof_student_id_33f2f772c49db067_uniq` (`student_id`,`field_name`), - KEY `courseware_xmodulestudentinfofield_7e1499` (`field_name`), - KEY `courseware_xmodulestudentinfofield_42ff452e` (`student_id`), - KEY `courseware_xmodulestudentinfofield_3216ff68` (`created`), - KEY `courseware_xmodulestudentinfofield_5436e97a` (`modified`), - CONSTRAINT `student_id_refs_id_bfcfbe68` FOREIGN KEY (`student_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_xmodulestudentprefsfield`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_xmodulestudentprefsfield` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `field_name` varchar(64) NOT NULL, - `module_type` varchar(64) NOT NULL, - `value` longtext NOT NULL, - `student_id` int(11) NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_xmodulestudentprefs_student_id_2a5d275498b7a407_uniq` (`student_id`,`module_type`,`field_name`), - KEY `courseware_xmodulestudentprefsfield_7e1499` (`field_name`), - KEY `courseware_xmodulestudentprefsfield_2d8768ff` (`module_type`), - KEY `courseware_xmodulestudentprefsfield_42ff452e` (`student_id`), - KEY `courseware_xmodulestudentprefsfield_3216ff68` (`created`), - KEY `courseware_xmodulestudentprefsfield_5436e97a` (`modified`), - CONSTRAINT `student_id_refs_id_d7b9940b` FOREIGN KEY (`student_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `courseware_xmoduleuserstatesummaryfield`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `courseware_xmoduleuserstatesummaryfield` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `field_name` varchar(64) NOT NULL, - `usage_id` varchar(255) NOT NULL, - `value` longtext NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `courseware_xmodulecontentfi_definition_id_50fa4fd570cf2f4a_uniq` (`usage_id`,`field_name`), - KEY `courseware_xmodulecontentfield_7e1499` (`field_name`), - KEY `courseware_xmodulecontentfield_1d304ded` (`usage_id`), - KEY `courseware_xmodulecontentfield_3216ff68` (`created`), - KEY `courseware_xmodulecontentfield_5436e97a` (`modified`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditcourse`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditcourse` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_key` varchar(255) NOT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_key` (`course_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditcourse_providers`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditcourse_providers` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `creditcourse_id` int(11) NOT NULL, - `creditprovider_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `credit_creditcourse_provid_creditcourse_id_d626a766090895c_uniq` (`creditcourse_id`,`creditprovider_id`), - KEY `credit_creditcourse_providers_872fcb0` (`creditcourse_id`), - KEY `credit_creditcourse_providers_56a10efe` (`creditprovider_id`), - CONSTRAINT `creditcourse_id_refs_id_ada165e4` FOREIGN KEY (`creditcourse_id`) REFERENCES `credit_creditcourse` (`id`), - CONSTRAINT `creditprovider_id_refs_id_52467f1a` FOREIGN KEY (`creditprovider_id`) REFERENCES `credit_creditprovider` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_crediteligibility`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_crediteligibility` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `username` varchar(255) NOT NULL, - `course_id` int(11) NOT NULL, - `provider_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `credit_crediteligibility_username_936cb16677e83e_uniq` (`username`,`course_id`), - KEY `credit_crediteligibility_f774835d` (`username`), - KEY `credit_crediteligibility_ff48d8e5` (`course_id`), - KEY `credit_crediteligibility_d9e5df97` (`provider_id`), - CONSTRAINT `course_id_refs_id_eede15d0` FOREIGN KEY (`course_id`) REFERENCES `credit_creditcourse` (`id`), - CONSTRAINT `provider_id_refs_id_561c64e6` FOREIGN KEY (`provider_id`) REFERENCES `credit_creditprovider` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditprovider`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditprovider` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `provider_id` varchar(255) NOT NULL, - `display_name` varchar(255) NOT NULL, - `provider_url` varchar(200) NOT NULL, - `eligibility_duration` int(10) unsigned NOT NULL, - `active` tinyint(1) NOT NULL, - `enable_integration` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `provider_id` (`provider_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditrequest`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditrequest` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `uuid` varchar(32) NOT NULL, - `username` varchar(255) NOT NULL, - `course_id` int(11) NOT NULL, - `provider_id` int(11) NOT NULL, - `timestamp` datetime NOT NULL, - `parameters` longtext NOT NULL, - `status` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `uuid` (`uuid`), - UNIQUE KEY `credit_creditrequest_username_4f61c10bb0d67c01_uniq` (`username`,`course_id`,`provider_id`), - KEY `credit_creditrequest_f774835d` (`username`), - KEY `credit_creditrequest_ff48d8e5` (`course_id`), - KEY `credit_creditrequest_d9e5df97` (`provider_id`), - CONSTRAINT `course_id_refs_id_96abc610` FOREIGN KEY (`course_id`) REFERENCES `credit_creditcourse` (`id`), - CONSTRAINT `provider_id_refs_id_df6afe06` FOREIGN KEY (`provider_id`) REFERENCES `credit_creditprovider` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditrequirement`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditrequirement` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_id` int(11) NOT NULL, - `namespace` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `active` tinyint(1) NOT NULL, - `criteria` longtext NOT NULL, - `display_name` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `credit_creditrequirement_namespace_33039c83b3e69b8_uniq` (`namespace`,`name`,`course_id`), - KEY `credit_creditrequirement_ff48d8e5` (`course_id`), - CONSTRAINT `course_id_refs_id_a417c522` FOREIGN KEY (`course_id`) REFERENCES `credit_creditcourse` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_creditrequirementstatus`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_creditrequirementstatus` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `username` varchar(255) NOT NULL, - `requirement_id` int(11) NOT NULL, - `status` varchar(32) NOT NULL, - `reason` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `credit_creditrequirementstatus_f774835d` (`username`), - KEY `credit_creditrequirementstatus_99a85f32` (`requirement_id`), - CONSTRAINT `requirement_id_refs_id_1f08312b` FOREIGN KEY (`requirement_id`) REFERENCES `credit_creditrequirement` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_historicalcreditrequest`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_historicalcreditrequest` ( - `id` int(11) NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `uuid` varchar(32) NOT NULL, - `username` varchar(255) NOT NULL, - `timestamp` datetime NOT NULL, - `parameters` longtext NOT NULL, - `status` varchar(255) NOT NULL, - `course_id` int(11) DEFAULT NULL, - `provider_id` int(11) DEFAULT NULL, - `history_id` int(11) NOT NULL AUTO_INCREMENT, - `history_date` datetime NOT NULL, - `history_user_id` int(11) DEFAULT NULL, - `history_type` varchar(1) NOT NULL, - PRIMARY KEY (`history_id`), - KEY `credit_historicalcreditrequest_4a5fc416` (`id`), - KEY `credit_historicalcreditrequest_2bbc74ae` (`uuid`), - KEY `credit_historicalcreditrequest_f774835d` (`username`), - KEY `credit_historicalcreditrequest_ff48d8e5` (`course_id`), - KEY `credit_historicalcreditrequest_d9e5df97` (`provider_id`), - KEY `credit_historicalcreditrequest_e1a0ea2a` (`history_user_id`), - CONSTRAINT `course_id_refs_id_b034099e` FOREIGN KEY (`course_id`) REFERENCES `credit_creditcourse` (`id`), - CONSTRAINT `history_user_id_refs_id_3ef1516a` FOREIGN KEY (`history_user_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `provider_id_refs_id_72d984b8` FOREIGN KEY (`provider_id`) REFERENCES `credit_creditprovider` (`id`) -) 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_5c5fe834` 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 */; -CREATE TABLE `django_admin_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `action_time` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `content_type_id` int(11) DEFAULT NULL, - `object_id` longtext, - `object_repr` varchar(200) NOT NULL, - `action_flag` smallint(5) unsigned NOT NULL, - `change_message` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `django_admin_log_fbfc09f1` (`user_id`), - KEY `django_admin_log_e4470c6e` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_c8665aa` 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 `django_comment_client_permission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_comment_client_permission` ( - `name` varchar(30) NOT NULL, - PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_comment_client_permission_roles`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_comment_client_permission_roles` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `permission_id` varchar(30) NOT NULL, - `role_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `django_comment_client_permi_permission_id_7a766da089425952_uniq` (`permission_id`,`role_id`), - KEY `django_comment_client_permission_roles_1e014c8f` (`permission_id`), - KEY `django_comment_client_permission_roles_bf07f040` (`role_id`), - CONSTRAINT `permission_id_refs_name_b6302d27` FOREIGN KEY (`permission_id`) REFERENCES `django_comment_client_permission` (`name`), - CONSTRAINT `role_id_refs_id_c1b5c854` FOREIGN KEY (`role_id`) REFERENCES `django_comment_client_role` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_comment_client_role`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_comment_client_role` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) NOT NULL, - `course_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `django_comment_client_role_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_comment_client_role_users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_comment_client_role_users` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `role_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `django_comment_client_role_users_role_id_78e483f531943614_uniq` (`role_id`,`user_id`), - KEY `django_comment_client_role_users_bf07f040` (`role_id`), - KEY `django_comment_client_role_users_fbfc09f1` (`user_id`), - CONSTRAINT `role_id_refs_id_ab82c838` FOREIGN KEY (`role_id`) REFERENCES `django_comment_client_role` (`id`), - CONSTRAINT `user_id_refs_id_441b79e7` 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 `django_content_type`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_content_type` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `app_label` varchar(100) NOT NULL, - `model` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `app_label` (`app_label`,`model`) -) ENGINE=InnoDB AUTO_INCREMENT=191 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 */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_openid_auth_association` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `server_url` longtext NOT NULL, - `handle` varchar(255) NOT NULL, - `secret` longtext NOT NULL, - `issued` int(11) NOT NULL, - `lifetime` int(11) NOT NULL, - `assoc_type` longtext NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_openid_auth_nonce`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_openid_auth_nonce` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `server_url` varchar(2047) NOT NULL, - `timestamp` int(11) NOT NULL, - `salt` varchar(40) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_openid_auth_useropenid`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_openid_auth_useropenid` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `claimed_id` longtext NOT NULL, - `display_id` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `django_openid_auth_useropenid_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_be7162f0` 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 `django_session`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_session` ( - `session_key` varchar(40) NOT NULL, - `session_data` longtext NOT NULL, - `expire_date` datetime NOT NULL, - PRIMARY KEY (`session_key`), - KEY `django_session_c25c2c28` (`expire_date`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `django_site`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `django_site` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `domain` varchar(100) NOT NULL, - `name` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `djcelery_crontabschedule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_crontabschedule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `minute` varchar(64) NOT NULL, - `hour` varchar(64) NOT NULL, - `day_of_week` varchar(64) NOT NULL, - `day_of_month` varchar(64) NOT NULL, - `month_of_year` varchar(64) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `djcelery_intervalschedule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_intervalschedule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `every` int(11) NOT NULL, - `period` varchar(24) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `djcelery_periodictask`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_periodictask` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(200) NOT NULL, - `task` varchar(200) NOT NULL, - `interval_id` int(11) DEFAULT NULL, - `crontab_id` int(11) DEFAULT NULL, - `args` longtext NOT NULL, - `kwargs` longtext NOT NULL, - `queue` varchar(200) DEFAULT NULL, - `exchange` varchar(200) DEFAULT NULL, - `routing_key` varchar(200) DEFAULT NULL, - `expires` datetime DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `last_run_at` datetime DEFAULT NULL, - `total_run_count` int(10) unsigned NOT NULL, - `date_changed` datetime NOT NULL, - `description` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`), - KEY `djcelery_periodictask_17d2d99d` (`interval_id`), - KEY `djcelery_periodictask_7aa5fda` (`crontab_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`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_periodictasks` ( - `ident` smallint(6) NOT NULL, - `last_update` datetime NOT NULL, - PRIMARY KEY (`ident`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `djcelery_taskstate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_taskstate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `state` varchar(64) NOT NULL, - `task_id` varchar(36) NOT NULL, - `name` varchar(200) DEFAULT NULL, - `tstamp` datetime NOT NULL, - `args` longtext, - `kwargs` longtext, - `eta` datetime DEFAULT NULL, - `expires` datetime DEFAULT NULL, - `result` longtext, - `traceback` longtext, - `runtime` double DEFAULT NULL, - `retries` int(11) NOT NULL, - `worker_id` int(11) DEFAULT NULL, - `hidden` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `task_id` (`task_id`), - KEY `djcelery_taskstate_355bfc27` (`state`), - KEY `djcelery_taskstate_52094d6e` (`name`), - KEY `djcelery_taskstate_f0ba6500` (`tstamp`), - KEY `djcelery_taskstate_20fc5b84` (`worker_id`), - KEY `djcelery_taskstate_c91f1bf` (`hidden`), - CONSTRAINT `worker_id_refs_id_4e3453a` FOREIGN KEY (`worker_id`) REFERENCES `djcelery_workerstate` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `djcelery_workerstate`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `djcelery_workerstate` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `hostname` varchar(255) NOT NULL, - `last_heartbeat` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `hostname` (`hostname`), - KEY `djcelery_workerstate_eb8ac7e4` (`last_heartbeat`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `edxval_coursevideo`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `edxval_coursevideo` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `video_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `edxval_coursevideo_course_id_42cecee05cff2d8c_uniq` (`course_id`,`video_id`), - KEY `edxval_coursevideo_fa26288c` (`video_id`), - CONSTRAINT `video_id_refs_id_7520c050` FOREIGN KEY (`video_id`) REFERENCES `edxval_video` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `edxval_encodedvideo`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `edxval_encodedvideo` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `url` varchar(200) NOT NULL, - `file_size` int(10) unsigned NOT NULL, - `bitrate` int(10) unsigned NOT NULL, - `profile_id` int(11) NOT NULL, - `video_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `edxval_encodedvideo_141c6eec` (`profile_id`), - KEY `edxval_encodedvideo_fa26288c` (`video_id`), - CONSTRAINT `profile_id_refs_id_692d754` FOREIGN KEY (`profile_id`) REFERENCES `edxval_profile` (`id`), - CONSTRAINT `video_id_refs_id_176ce1a0` FOREIGN KEY (`video_id`) REFERENCES `edxval_video` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `edxval_profile`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `edxval_profile` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `profile_name` varchar(50) NOT NULL, - `extension` varchar(10) DEFAULT 'mp4', - `width` int(10) unsigned DEFAULT '1', - `height` int(10) unsigned DEFAULT '1', - PRIMARY KEY (`id`), - UNIQUE KEY `profile_name` (`profile_name`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `edxval_subtitle`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `edxval_subtitle` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `video_id` int(11) NOT NULL, - `fmt` varchar(20) NOT NULL, - `language` varchar(8) NOT NULL, - `content` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `edxval_subtitle_fa26288c` (`video_id`), - KEY `edxval_subtitle_306df28f` (`fmt`), - KEY `edxval_subtitle_8a7ac9ab` (`language`), - CONSTRAINT `video_id_refs_id_788bc3d3` FOREIGN KEY (`video_id`) REFERENCES `edxval_video` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `edxval_video`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `edxval_video` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `edx_video_id` varchar(100) NOT NULL, - `client_video_id` varchar(255) NOT NULL, - `duration` double NOT NULL, - `created` datetime NOT NULL, - `status` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `edx_video_id` (`edx_video_id`), - KEY `edxval_video_de3f5709` (`client_video_id`), - KEY `edxval_video_c9ad71dd` (`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `embargo_country`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `embargo_country` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `country` varchar(2) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `country` (`country`) -) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `embargo_countryaccessrule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `embargo_countryaccessrule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `rule_type` varchar(255) NOT NULL, - `restricted_course_id` int(11) NOT NULL, - `country_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `embargo_countryacces_restricted_course_id_6f340c36c633cb0a_uniq` (`restricted_course_id`,`country_id`), - KEY `embargo_countryaccessrule_3cd064f4` (`restricted_course_id`), - KEY `embargo_countryaccessrule_534dd89` (`country_id`), - CONSTRAINT `country_id_refs_id_f679fa73` FOREIGN KEY (`country_id`) REFERENCES `embargo_country` (`id`), - CONSTRAINT `restricted_course_id_refs_id_c792331c` FOREIGN KEY (`restricted_course_id`) REFERENCES `embargo_restrictedcourse` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `embargo_courseaccessrulehistory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `embargo_courseaccessrulehistory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` datetime NOT NULL, - `course_key` varchar(255) NOT NULL, - `snapshot` longtext, - PRIMARY KEY (`id`), - KEY `embargo_courseaccessrulehistory_67f1b7ce` (`timestamp`), - KEY `embargo_courseaccessrulehistory_b4b47e7a` (`course_key`) -) 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_d0205d39` 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_22c1f5d3` 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_restrictedcourse`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `embargo_restrictedcourse` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_key` varchar(255) NOT NULL, - `enroll_msg_key` varchar(255) NOT NULL, - `access_msg_key` varchar(255) NOT NULL, - `disable_access_check` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `course_key` (`course_key`) -) 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 */; -CREATE TABLE `external_auth_externalauthmap` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `external_id` varchar(255) NOT NULL, - `external_domain` varchar(255) NOT NULL, - `external_credentials` longtext NOT NULL, - `external_email` varchar(255) NOT NULL, - `external_name` varchar(255) NOT NULL, - `user_id` int(11) DEFAULT NULL, - `internal_password` varchar(31) NOT NULL, - `dtcreated` datetime NOT NULL, - `dtsignup` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `external_auth_externalauthmap_external_id_7f035ef8bc4d313e_uniq` (`external_id`,`external_domain`), - UNIQUE KEY `user_id` (`user_id`), - KEY `external_auth_externalauthmap_d5e787` (`external_id`), - KEY `external_auth_externalauthmap_a570024c` (`external_domain`), - KEY `external_auth_externalauthmap_a142061d` (`external_email`), - KEY `external_auth_externalauthmap_c1a016f` (`external_name`), - CONSTRAINT `user_id_refs_id_f8635f67` 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 `foldit_puzzlecomplete`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `foldit_puzzlecomplete` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `unique_user_id` varchar(50) NOT NULL, - `puzzle_id` int(11) NOT NULL, - `puzzle_set` int(11) NOT NULL, - `puzzle_subset` int(11) NOT NULL, - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `foldit_puzzlecomplete_user_id_4c63656af6674331_uniq` (`user_id`,`puzzle_id`,`puzzle_set`,`puzzle_subset`), - KEY `foldit_puzzlecomplete_fbfc09f1` (`user_id`), - KEY `foldit_puzzlecomplete_8027477e` (`unique_user_id`), - KEY `foldit_puzzlecomplete_4798a2b8` (`puzzle_set`), - KEY `foldit_puzzlecomplete_59f06bcd` (`puzzle_subset`), - CONSTRAINT `user_id_refs_id_37e9437b` 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 `foldit_score`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `foldit_score` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `unique_user_id` varchar(50) NOT NULL, - `puzzle_id` int(11) NOT NULL, - `best_score` double NOT NULL, - `current_score` double NOT NULL, - `score_version` int(11) NOT NULL, - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `foldit_score_fbfc09f1` (`user_id`), - KEY `foldit_score_8027477e` (`unique_user_id`), - KEY `foldit_score_3624c060` (`best_score`), - KEY `foldit_score_b4627792` (`current_score`), - CONSTRAINT `user_id_refs_id_4c07957f` 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 `instructor_task_instructortask`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `instructor_task_instructortask` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `task_type` varchar(50) NOT NULL, - `course_id` varchar(255) NOT NULL, - `task_key` varchar(255) NOT NULL, - `task_input` varchar(255) NOT NULL, - `task_id` varchar(255) NOT NULL, - `task_state` varchar(50) DEFAULT NULL, - `task_output` varchar(1024) DEFAULT NULL, - `requester_id` int(11) NOT NULL, - `created` datetime DEFAULT NULL, - `updated` datetime NOT NULL, - `subtasks` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `instructor_task_instructortask_8ae638b4` (`task_type`), - KEY `instructor_task_instructortask_ff48d8e5` (`course_id`), - KEY `instructor_task_instructortask_cfc55170` (`task_key`), - KEY `instructor_task_instructortask_c00fe455` (`task_id`), - KEY `instructor_task_instructortask_731e67a4` (`task_state`), - KEY `instructor_task_instructortask_b8ca8b9f` (`requester_id`), - CONSTRAINT `requester_id_refs_id_a97278e6` FOREIGN KEY (`requester_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `licenses_coursesoftware`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `licenses_coursesoftware` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `full_name` varchar(255) NOT NULL, - `url` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `licenses_userlicense`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `licenses_userlicense` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `software_id` int(11) NOT NULL, - `user_id` int(11) DEFAULT NULL, - `serial` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `licenses_userlicense_4c6ed3c1` (`software_id`), - KEY `licenses_userlicense_fbfc09f1` (`user_id`), - CONSTRAINT `software_id_refs_id_f9e27be8` FOREIGN KEY (`software_id`) REFERENCES `licenses_coursesoftware` (`id`), - CONSTRAINT `user_id_refs_id_2f3a1cb3` 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 `lms_xblock_xblockasidesconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `lms_xblock_xblockasidesconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `disabled_blocks` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `lms_xblock_xblockasidesconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_552627bc` 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 `milestones_coursecontentmilestone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `milestones_coursecontentmilestone` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_id` varchar(255) NOT NULL, - `content_id` varchar(255) NOT NULL, - `milestone_id` int(11) NOT NULL, - `milestone_relationship_type_id` int(11) NOT NULL, - `active` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `milestones_coursecontentmilesto_course_id_68d1457cd52d6dff_uniq` (`course_id`,`content_id`,`milestone_id`), - KEY `milestones_coursecontentmilestone_ff48d8e5` (`course_id`), - KEY `milestones_coursecontentmilestone_cc8ff3c` (`content_id`), - KEY `milestones_coursecontentmilestone_9cfa291f` (`milestone_id`), - KEY `milestones_coursecontentmilestone_595c57ff` (`milestone_relationship_type_id`), - CONSTRAINT `milestone_id_refs_id_d7fabedc` FOREIGN KEY (`milestone_id`) REFERENCES `milestones_milestone` (`id`), - CONSTRAINT `milestone_relationship_type_id_refs_id_d7ab186` FOREIGN KEY (`milestone_relationship_type_id`) REFERENCES `milestones_milestonerelationshiptype` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `milestones_coursemilestone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `milestones_coursemilestone` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `course_id` varchar(255) NOT NULL, - `milestone_id` int(11) NOT NULL, - `milestone_relationship_type_id` int(11) NOT NULL, - `active` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `milestones_coursemilestone_course_id_5a06e10579eab3b7_uniq` (`course_id`,`milestone_id`), - KEY `milestones_coursemilestone_ff48d8e5` (`course_id`), - KEY `milestones_coursemilestone_9cfa291f` (`milestone_id`), - KEY `milestones_coursemilestone_595c57ff` (`milestone_relationship_type_id`), - CONSTRAINT `milestone_id_refs_id_cd764354` FOREIGN KEY (`milestone_id`) REFERENCES `milestones_milestone` (`id`), - CONSTRAINT `milestone_relationship_type_id_refs_id_874a03b6` FOREIGN KEY (`milestone_relationship_type_id`) REFERENCES `milestones_milestonerelationshiptype` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `milestones_milestone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `milestones_milestone` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `namespace` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `display_name` varchar(255) NOT NULL, - `description` longtext NOT NULL, - `active` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `milestones_milestone_namespace_460a2f6943016c0b_uniq` (`namespace`,`name`), - KEY `milestones_milestone_eb040977` (`namespace`), - KEY `milestones_milestone_52094d6e` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `milestones_milestonerelationshiptype`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `milestones_milestonerelationshiptype` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `name` varchar(25) NOT NULL, - `description` longtext NOT NULL, - `active` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `milestones_usermilestone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `milestones_usermilestone` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `milestone_id` int(11) NOT NULL, - `source` longtext NOT NULL, - `collected` datetime DEFAULT NULL, - `active` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `milestones_usermilestone_user_id_10206aa452468351_uniq` (`user_id`,`milestone_id`), - KEY `milestones_usermilestone_fbfc09f1` (`user_id`), - KEY `milestones_usermilestone_9cfa291f` (`milestone_id`), - CONSTRAINT `milestone_id_refs_id_af7fa460` FOREIGN KEY (`milestone_id`) REFERENCES `milestones_milestone` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `mobile_api_mobileapiconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `mobile_api_mobileapiconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `video_profiles` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `mobile_api_mobileapiconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_97c2f4c8` 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 `notes_note`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notes_note` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `uri` varchar(255) NOT NULL, - `text` longtext NOT NULL, - `quote` longtext NOT NULL, - `range_start` varchar(2048) NOT NULL, - `range_start_offset` int(11) NOT NULL, - `range_end` varchar(2048) NOT NULL, - `range_end_offset` int(11) NOT NULL, - `tags` longtext NOT NULL, - `created` datetime DEFAULT NULL, - `updated` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `notes_note_fbfc09f1` (`user_id`), - KEY `notes_note_ff48d8e5` (`course_id`), - KEY `notes_note_a9794fa` (`uri`), - KEY `notes_note_3216ff68` (`created`), - KEY `notes_note_8aac229` (`updated`), - CONSTRAINT `user_id_refs_id_360715cc` 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 `notifications_articlesubscription`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notifications_articlesubscription` ( - `subscription_ptr_id` int(11) NOT NULL, - `articleplugin_ptr_id` int(11) NOT NULL, - PRIMARY KEY (`articleplugin_ptr_id`), - UNIQUE KEY `subscription_ptr_id` (`subscription_ptr_id`), - CONSTRAINT `articleplugin_ptr_id_refs_id_71ed584a` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`), - CONSTRAINT `subscription_ptr_id_refs_id_75c0b518` FOREIGN KEY (`subscription_ptr_id`) REFERENCES `notify_subscription` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `notify_notification`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notify_notification` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `subscription_id` int(11) DEFAULT NULL, - `message` longtext NOT NULL, - `url` varchar(200) DEFAULT NULL, - `is_viewed` tinyint(1) NOT NULL, - `is_emailed` tinyint(1) NOT NULL, - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `notify_notification_104f5ac1` (`subscription_id`), - CONSTRAINT `subscription_id_refs_id_baf93d4f` FOREIGN KEY (`subscription_id`) REFERENCES `notify_subscription` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `notify_notificationtype`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notify_notificationtype` ( - `key` varchar(128) NOT NULL, - `label` varchar(128) DEFAULT NULL, - `content_type_id` int(11) DEFAULT NULL, - PRIMARY KEY (`key`), - KEY `notify_notificationtype_e4470c6e` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_f2478378` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `notify_settings`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notify_settings` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `interval` smallint(6) NOT NULL, - PRIMARY KEY (`id`), - KEY `notify_settings_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_9a2911e6` 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 `notify_subscription`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notify_subscription` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `settings_id` int(11) NOT NULL, - `notification_type_id` varchar(128) NOT NULL, - `object_id` varchar(64) DEFAULT NULL, - `send_emails` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `notify_subscription_83326d99` (`settings_id`), - KEY `notify_subscription_9955f091` (`notification_type_id`), - CONSTRAINT `notification_type_id_refs_key_baa41a19` FOREIGN KEY (`notification_type_id`) REFERENCES `notify_notificationtype` (`key`), - CONSTRAINT `settings_id_refs_id_3b7225d5` FOREIGN KEY (`settings_id`) REFERENCES `notify_settings` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `oauth2_accesstoken`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `oauth2_accesstoken` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `token` varchar(255) NOT NULL, - `client_id` int(11) NOT NULL, - `expires` datetime NOT NULL, - `scope` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `oauth2_accesstoken_fbfc09f1` (`user_id`), - KEY `oauth2_accesstoken_4a4e8ffb` (`client_id`), - KEY `oauth2_accesstoken_bfac9f99` (`token`), - CONSTRAINT `client_id_refs_id_e566ebcc` FOREIGN KEY (`client_id`) REFERENCES `oauth2_client` (`id`), - CONSTRAINT `user_id_refs_id_c740ddb9` 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 `oauth2_client`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `oauth2_client` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11), - `url` varchar(200) NOT NULL, - `redirect_uri` varchar(200) NOT NULL, - `client_id` varchar(255) NOT NULL, - `client_secret` varchar(255) NOT NULL, - `client_type` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `oauth2_client_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_c2e3e9a0` 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 `oauth2_grant`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `oauth2_grant` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `client_id` int(11) NOT NULL, - `code` varchar(255) NOT NULL, - `expires` datetime NOT NULL, - `redirect_uri` varchar(255) NOT NULL, - `scope` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `oauth2_grant_fbfc09f1` (`user_id`), - KEY `oauth2_grant_4a4e8ffb` (`client_id`), - CONSTRAINT `client_id_refs_id_b2f66ded` FOREIGN KEY (`client_id`) REFERENCES `oauth2_client` (`id`), - CONSTRAINT `user_id_refs_id_37f50fe6` 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 `oauth2_provider_trustedclient`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `oauth2_provider_trustedclient` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `client_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `oauth2_provider_trustedclient_4a4e8ffb` (`client_id`), - CONSTRAINT `client_id_refs_id_f6dfcacc` FOREIGN KEY (`client_id`) REFERENCES `oauth2_client` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `oauth2_refreshtoken`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `oauth2_refreshtoken` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `token` varchar(255) NOT NULL, - `access_token_id` int(11) NOT NULL, - `client_id` int(11) NOT NULL, - `expired` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `access_token_id` (`access_token_id`), - KEY `oauth2_refreshtoken_fbfc09f1` (`user_id`), - KEY `oauth2_refreshtoken_4a4e8ffb` (`client_id`), - CONSTRAINT `access_token_id_refs_id_df7961b9` FOREIGN KEY (`access_token_id`) REFERENCES `oauth2_accesstoken` (`id`), - CONSTRAINT `client_id_refs_id_798730c8` FOREIGN KEY (`client_id`) REFERENCES `oauth2_client` (`id`), - CONSTRAINT `user_id_refs_id_78216905` 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 `psychometrics_psychometricdata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `psychometrics_psychometricdata` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `studentmodule_id` int(11) NOT NULL, - `done` tinyint(1) NOT NULL, - `attempts` int(11) NOT NULL, - `checktimes` longtext, - PRIMARY KEY (`id`), - UNIQUE KEY `studentmodule_id` (`studentmodule_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 */; -CREATE TABLE `shoppingcart_certificateitem` ( - `orderitem_ptr_id` int(11) NOT NULL, - `course_id` varchar(128) NOT NULL, - `course_enrollment_id` int(11) NOT NULL, - `mode` varchar(50) NOT NULL, - PRIMARY KEY (`orderitem_ptr_id`), - KEY `shoppingcart_certificateitem_ff48d8e5` (`course_id`), - KEY `shoppingcart_certificateitem_9e513f0b` (`course_enrollment_id`), - KEY `shoppingcart_certificateitem_4160619e` (`mode`), - CONSTRAINT `course_enrollment_id_refs_id_8048c435` FOREIGN KEY (`course_enrollment_id`) REFERENCES `student_courseenrollment` (`id`), - CONSTRAINT `orderitem_ptr_id_refs_id_d3ebc4d0` FOREIGN KEY (`orderitem_ptr_id`) REFERENCES `shoppingcart_orderitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_coupon`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_coupon` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(32) NOT NULL, - `description` varchar(255) DEFAULT NULL, - `course_id` varchar(255) NOT NULL, - `percentage_discount` int(11) NOT NULL, - `created_by_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - `is_active` tinyint(1) NOT NULL, - `expiration_date` datetime, - PRIMARY KEY (`id`), - KEY `shoppingcart_coupon_65da3d2c` (`code`), - KEY `shoppingcart_coupon_b5de30be` (`created_by_id`), - CONSTRAINT `created_by_id_refs_id_259aadc` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_couponredemption`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_couponredemption` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `coupon_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_couponredemption_8337030b` (`order_id`), - KEY `shoppingcart_couponredemption_fbfc09f1` (`user_id`), - KEY `shoppingcart_couponredemption_c29b2e60` (`coupon_id`), - CONSTRAINT `coupon_id_refs_id_c11a8022` FOREIGN KEY (`coupon_id`) REFERENCES `shoppingcart_coupon` (`id`), - CONSTRAINT `order_id_refs_id_f5db1967` FOREIGN KEY (`order_id`) REFERENCES `shoppingcart_order` (`id`), - CONSTRAINT `user_id_refs_id_5e9b8167` 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 `shoppingcart_courseregcodeitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_courseregcodeitem` ( - `orderitem_ptr_id` int(11) NOT NULL, - `course_id` varchar(128) NOT NULL, - `mode` varchar(50) NOT NULL, - PRIMARY KEY (`orderitem_ptr_id`), - KEY `shoppingcart_courseregcodeitem_ff48d8e5` (`course_id`), - KEY `shoppingcart_courseregcodeitem_4160619e` (`mode`), - CONSTRAINT `orderitem_ptr_id_refs_id_a466f07f` FOREIGN KEY (`orderitem_ptr_id`) REFERENCES `shoppingcart_orderitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_courseregcodeitemannotation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_courseregcodeitemannotation` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(128) NOT NULL, - `annotation` longtext, - 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 `shoppingcart_courseregistrationcode`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_courseregistrationcode` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(32) NOT NULL, - `course_id` varchar(255) NOT NULL, - `created_by_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - `invoice_id` int(11), - `order_id` int(11), - `mode_slug` varchar(100), - `invoice_item_id` int(11), - `is_valid` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `shoppingcart_courseregistrationcode_code_6614bad3cae62199_uniq` (`code`), - KEY `shoppingcart_courseregistrationcode_65da3d2c` (`code`), - KEY `shoppingcart_courseregistrationcode_ff48d8e5` (`course_id`), - KEY `shoppingcart_courseregistrationcode_b5de30be` (`created_by_id`), - KEY `shoppingcart_courseregistrationcode_59f72b12` (`invoice_id`), - KEY `shoppingcart_courseregistrationcode_8337030b` (`order_id`), - KEY `shoppingcart_courseregistrationcode_80766641` (`invoice_item_id`), - CONSTRAINT `created_by_id_refs_id_38397037` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `invoice_id_refs_id_995f0ae8` FOREIGN KEY (`invoice_id`) REFERENCES `shoppingcart_invoice` (`id`), - CONSTRAINT `invoice_item_id_refs_invoiceitem_ptr_id_8a5558e6` FOREIGN KEY (`invoice_item_id`) REFERENCES `shoppingcart_courseregistrationcodeinvoiceitem` (`invoiceitem_ptr_id`), - CONSTRAINT `order_id_refs_id_be36d837` FOREIGN KEY (`order_id`) REFERENCES `shoppingcart_order` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_courseregistrationcodeinvoiceitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_courseregistrationcodeinvoiceitem` ( - `invoiceitem_ptr_id` int(11) NOT NULL, - `course_id` varchar(128) NOT NULL, - PRIMARY KEY (`invoiceitem_ptr_id`), - KEY `shoppingcart_courseregistrationcodeinvoiceitem_ff48d8e5` (`course_id`), - CONSTRAINT `invoiceitem_ptr_id_refs_id_74a11b46` FOREIGN KEY (`invoiceitem_ptr_id`) REFERENCES `shoppingcart_invoiceitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_donation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_donation` ( - `orderitem_ptr_id` int(11) NOT NULL, - `donation_type` varchar(32) NOT NULL, - `course_id` varchar(255) NOT NULL, - PRIMARY KEY (`orderitem_ptr_id`), - KEY `shoppingcart_donation_ff48d8e5` (`course_id`), - CONSTRAINT `orderitem_ptr_id_refs_id_b7138a4b` FOREIGN KEY (`orderitem_ptr_id`) REFERENCES `shoppingcart_orderitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_donationconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_donationconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_donationconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_b4a26b7f` 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 `shoppingcart_invoice`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_invoice` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `total_amount` double NOT NULL, - `company_name` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - `internal_reference` varchar(255), - `is_valid` tinyint(1) NOT NULL, - `address_line_1` varchar(255) NOT NULL, - `address_line_2` varchar(255), - `address_line_3` varchar(255), - `city` varchar(255), - `state` varchar(255), - `zip` varchar(15), - `country` varchar(64), - `recipient_name` varchar(255) NOT NULL, - `recipient_email` varchar(255) NOT NULL, - `customer_reference_number` varchar(63), - `company_contact_name` varchar(255) NOT NULL, - `company_contact_email` varchar(255) NOT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_invoice_ca9021a2` (`company_name`), - KEY `shoppingcart_invoice_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_invoicehistory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_invoicehistory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` datetime NOT NULL, - `invoice_id` int(11) NOT NULL, - `snapshot` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_invoicehistory_67f1b7ce` (`timestamp`), - KEY `shoppingcart_invoicehistory_59f72b12` (`invoice_id`), - CONSTRAINT `invoice_id_refs_id_239c2b7c` FOREIGN KEY (`invoice_id`) REFERENCES `shoppingcart_invoice` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_invoiceitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_invoiceitem` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `invoice_id` int(11) NOT NULL, - `qty` int(11) NOT NULL, - `unit_price` decimal(30,2) NOT NULL, - `currency` varchar(8) NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_invoiceitem_59f72b12` (`invoice_id`), - CONSTRAINT `invoice_id_refs_id_5c894802` FOREIGN KEY (`invoice_id`) REFERENCES `shoppingcart_invoice` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_invoicetransaction`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_invoicetransaction` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `invoice_id` int(11) NOT NULL, - `amount` decimal(30,2) NOT NULL, - `currency` varchar(8) NOT NULL, - `comments` longtext, - `status` varchar(32) NOT NULL, - `created_by_id` int(11) NOT NULL, - `last_modified_by_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_invoicetransaction_59f72b12` (`invoice_id`), - KEY `shoppingcart_invoicetransaction_b5de30be` (`created_by_id`), - KEY `shoppingcart_invoicetransaction_bcd6c6d2` (`last_modified_by_id`), - CONSTRAINT `created_by_id_refs_id_7259d0bb` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `invoice_id_refs_id_8e5b62ec` FOREIGN KEY (`invoice_id`) REFERENCES `shoppingcart_invoice` (`id`), - CONSTRAINT `last_modified_by_id_refs_id_7259d0bb` FOREIGN KEY (`last_modified_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_order`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_order` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `currency` varchar(8) NOT NULL, - `status` varchar(32) NOT NULL, - `purchase_time` datetime DEFAULT NULL, - `bill_to_first` varchar(64) NOT NULL, - `bill_to_last` varchar(64) NOT NULL, - `bill_to_street1` varchar(128) NOT NULL, - `bill_to_street2` varchar(128) NOT NULL, - `bill_to_city` varchar(64) NOT NULL, - `bill_to_state` varchar(8) NOT NULL, - `bill_to_postalcode` varchar(16) NOT NULL, - `bill_to_country` varchar(64) NOT NULL, - `bill_to_ccnum` varchar(8) NOT NULL, - `bill_to_cardtype` varchar(32) NOT NULL, - `processor_reply_dump` longtext NOT NULL, - `refunded_time` datetime, - `company_name` varchar(255), - `company_contact_name` varchar(255), - `company_contact_email` varchar(255), - `recipient_name` varchar(255), - `recipient_email` varchar(255), - `customer_reference_number` varchar(63), - `order_type` varchar(32) NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_order_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_e1195673` 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 `shoppingcart_orderitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_orderitem` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `status` varchar(32) NOT NULL, - `qty` int(11) NOT NULL, - `unit_cost` decimal(30,2) NOT NULL, - `line_desc` varchar(1024) NOT NULL, - `currency` varchar(8) NOT NULL, - `fulfilled_time` datetime, - `report_comments` longtext NOT NULL, - `refund_requested_time` datetime, - `service_fee` decimal(30,2) NOT NULL, - `list_price` decimal(30,2), - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `shoppingcart_orderitem_8337030b` (`order_id`), - KEY `shoppingcart_orderitem_fbfc09f1` (`user_id`), - KEY `shoppingcart_orderitem_c9ad71dd` (`status`), - KEY `shoppingcart_orderitem_8457f26a` (`fulfilled_time`), - KEY `shoppingcart_orderitem_416112c1` (`refund_requested_time`), - CONSTRAINT `order_id_refs_id_7c77b3f0` FOREIGN KEY (`order_id`) REFERENCES `shoppingcart_order` (`id`), - CONSTRAINT `user_id_refs_id_d92ae410` 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 `shoppingcart_paidcourseregistration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_paidcourseregistration` ( - `orderitem_ptr_id` int(11) NOT NULL, - `course_id` varchar(128) NOT NULL, - `mode` varchar(50) NOT NULL, - `course_enrollment_id` int(11), - PRIMARY KEY (`orderitem_ptr_id`), - KEY `shoppingcart_paidcourseregistration_ff48d8e5` (`course_id`), - KEY `shoppingcart_paidcourseregistration_4160619e` (`mode`), - KEY `shoppingcart_paidcourseregistration_9e513f0b` (`course_enrollment_id`), - CONSTRAINT `course_enrollment_id_refs_id_dc061be6` FOREIGN KEY (`course_enrollment_id`) REFERENCES `student_courseenrollment` (`id`), - CONSTRAINT `orderitem_ptr_id_refs_id_d8709d99` FOREIGN KEY (`orderitem_ptr_id`) REFERENCES `shoppingcart_orderitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shoppingcart_paidcourseregistrationannotation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_paidcourseregistrationannotation` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(128) NOT NULL, - `annotation` longtext, - 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 `shoppingcart_registrationcoderedemption`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shoppingcart_registrationcoderedemption` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `order_id` int(11), - `registration_code_id` int(11) NOT NULL, - `redeemed_by_id` int(11) NOT NULL, - `redeemed_at` datetime DEFAULT NULL, - `course_enrollment_id` int(11), - PRIMARY KEY (`id`), - KEY `shoppingcart_registrationcoderedemption_8337030b` (`order_id`), - KEY `shoppingcart_registrationcoderedemption_d25b37dc` (`registration_code_id`), - KEY `shoppingcart_registrationcoderedemption_e151467a` (`redeemed_by_id`), - KEY `shoppingcart_registrationcoderedemption_9e513f0b` (`course_enrollment_id`), - CONSTRAINT `course_enrollment_id_refs_id_c9486127` FOREIGN KEY (`course_enrollment_id`) REFERENCES `student_courseenrollment` (`id`), - CONSTRAINT `order_id_refs_id_53a8a5c9` FOREIGN KEY (`order_id`) REFERENCES `shoppingcart_order` (`id`), - CONSTRAINT `redeemed_by_id_refs_id_4e320dc9` FOREIGN KEY (`redeemed_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `registration_code_id_refs_id_4d01e47b` FOREIGN KEY (`registration_code_id`) REFERENCES `shoppingcart_courseregistrationcode` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `south_migrationhistory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `south_migrationhistory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `app_name` varchar(255) NOT NULL, - `migration` varchar(255) NOT NULL, - `applied` datetime NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=259 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_9125b21c` 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 */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_anonymoususerid` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `anonymous_user_id` varchar(32) NOT NULL, - `course_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `anonymous_user_id` (`anonymous_user_id`), - KEY `student_anonymoususerid_fbfc09f1` (`user_id`), - KEY `student_anonymoususerid_ff48d8e5` (`course_id`), - CONSTRAINT `user_id_refs_id_c38f7a2a` 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_courseaccessrole`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_courseaccessrole` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `org` varchar(64) NOT NULL, - `course_id` varchar(255) NOT NULL, - `role` varchar(64) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_courseaccessrole_user_id_3203176c4f474414_uniq` (`user_id`,`org`,`course_id`,`role`), - KEY `student_courseaccessrole_fbfc09f1` (`user_id`), - KEY `student_courseaccessrole_4f5f82e2` (`org`), - KEY `student_courseaccessrole_ff48d8e5` (`course_id`), - KEY `student_courseaccessrole_e0b082a1` (`role`), - CONSTRAINT `user_id_refs_id_6ac23885` 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_courseenrollment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_courseenrollment` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `created` datetime DEFAULT NULL, - `is_active` tinyint(1) NOT NULL, - `mode` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_courseenrollment_user_id_2d2a572f07dd8e37_uniq` (`user_id`,`course_id`), - KEY `student_courseenrollment_fbfc09f1` (`user_id`), - KEY `student_courseenrollment_ff48d8e5` (`course_id`), - KEY `student_courseenrollment_3216ff68` (`created`), - CONSTRAINT `user_id_refs_id_ed37bc9d` 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_courseenrollmentallowed`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_courseenrollmentallowed` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `email` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - `created` datetime DEFAULT NULL, - `auto_enroll` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_courseenrollmentallowed_email_6f3eafd4a6c58591_uniq` (`email`,`course_id`), - KEY `student_courseenrollmentallowed_3904588a` (`email`), - KEY `student_courseenrollmentallowed_ff48d8e5` (`course_id`), - KEY `student_courseenrollmentallowed_3216ff68` (`created`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `student_courseenrollmentattribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_courseenrollmentattribute` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `enrollment_id` int(11) NOT NULL, - `namespace` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `value` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `student_courseenrollmentattribute_ab10102` (`enrollment_id`), - CONSTRAINT `enrollment_id_refs_id_974619de` FOREIGN KEY (`enrollment_id`) REFERENCES `student_courseenrollment` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `student_dashboardconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_dashboardconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `recent_enrollment_time_delta` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `student_dashboardconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_eec78c18` 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_entranceexamconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_entranceexamconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `created` datetime DEFAULT NULL, - `updated` datetime NOT NULL, - `skip_entrance_exam` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_entranceexamconfiguration_user_id_714c2ef6a88504f0_uniq` (`user_id`,`course_id`), - KEY `student_entranceexamconfiguration_fbfc09f1` (`user_id`), - KEY `student_entranceexamconfiguration_ff48d8e5` (`course_id`), - KEY `student_entranceexamconfiguration_3216ff68` (`created`), - KEY `student_entranceexamconfiguration_8aac229` (`updated`), - CONSTRAINT `user_id_refs_id_9c93dc16` 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_languageproficiency`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_languageproficiency` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_profile_id` int(11) NOT NULL, - `code` varchar(16) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_languageproficiency_code_68e76171684c62e5_uniq` (`code`,`user_profile_id`), - KEY `student_languageproficiency_634d39b9` (`user_profile_id`), - CONSTRAINT `user_profile_id_refs_id_ba5aae00` FOREIGN KEY (`user_profile_id`) REFERENCES `auth_userprofile` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `student_linkedinaddtoprofileconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_linkedinaddtoprofileconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `dashboard_tracking_code` longtext NOT NULL, - `company_identifier` longtext NOT NULL, - `trk_partner_name` varchar(10) NOT NULL, - PRIMARY KEY (`id`), - KEY `student_linkedinaddtoprofileconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_9469646a` 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_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_e6a71045` 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_manualenrollmentaudit`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_manualenrollmentaudit` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `enrollment_id` int(11) DEFAULT NULL, - `enrolled_by_id` int(11) DEFAULT NULL, - `enrolled_email` varchar(255) NOT NULL, - `time_stamp` datetime DEFAULT NULL, - `state_transition` varchar(255) NOT NULL, - `reason` longtext, - PRIMARY KEY (`id`), - KEY `student_manualenrollmentaudit_ab10102` (`enrollment_id`), - KEY `student_manualenrollmentaudit_a14a0576` (`enrolled_by_id`), - KEY `student_manualenrollmentaudit_3dd381cb` (`enrolled_email`), - CONSTRAINT `enrolled_by_id_refs_id_a8059256` FOREIGN KEY (`enrolled_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `enrollment_id_refs_id_a87a89ac` FOREIGN KEY (`enrollment_id`) REFERENCES `student_courseenrollment` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `student_passwordhistory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_passwordhistory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `password` varchar(128) NOT NULL, - `time_set` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `student_passwordhistory_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_ed0987da` 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 */; -CREATE TABLE `student_pendingemailchange` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `new_email` varchar(255) NOT NULL, - `activation_key` varchar(32) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - UNIQUE KEY `activation_key` (`activation_key`), - KEY `student_pendingemailchange_856c86d7` (`new_email`), - CONSTRAINT `user_id_refs_id_a525fa67` 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_pendingnamechange`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_pendingnamechange` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `new_name` varchar(255) NOT NULL, - `rationale` varchar(1024) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_d9359b27` 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_usersignupsource`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_usersignupsource` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `site` varchar(255) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `student_usersignupsource_e00a881a` (`site`), - KEY `student_usersignupsource_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_38a4bd6e` 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_userstanding`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_userstanding` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `account_status` varchar(31) NOT NULL, - `changed_by_id` int(11) NOT NULL, - `standing_last_changed_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - KEY `student_userstanding_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_450a33b` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `user_id_refs_id_450a33b` 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_usertestgroup`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_usertestgroup` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(32) NOT NULL, - `description` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `student_usertestgroup_52094d6e` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `student_usertestgroup_users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `student_usertestgroup_users` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `usertestgroup_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_usertestgroup_us_usertestgroup_id_63c588e0372991b0_uniq` (`usertestgroup_id`,`user_id`), - KEY `student_usertestgroup_users_44f27cdf` (`usertestgroup_id`), - KEY `student_usertestgroup_users_fbfc09f1` (`user_id`), - CONSTRAINT `user_id_refs_id_8947584c` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `usertestgroup_id_refs_id_6d724f9e` FOREIGN KEY (`usertestgroup_id`) REFERENCES `student_usertestgroup` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `submissions_score`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `submissions_score` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `student_item_id` int(11) NOT NULL, - `submission_id` int(11) DEFAULT NULL, - `points_earned` int(10) unsigned NOT NULL, - `points_possible` int(10) unsigned NOT NULL, - `created_at` datetime NOT NULL, - `reset` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `submissions_score_fa84001` (`student_item_id`), - KEY `submissions_score_b3d6235a` (`submission_id`), - KEY `submissions_score_3b1c9c31` (`created_at`), - CONSTRAINT `student_item_id_refs_id_8cd97385` FOREIGN KEY (`student_item_id`) REFERENCES `submissions_studentitem` (`id`), - CONSTRAINT `submission_id_refs_id_9e39cf2e` FOREIGN KEY (`submission_id`) REFERENCES `submissions_submission` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `submissions_scoresummary`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `submissions_scoresummary` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `student_item_id` int(11) NOT NULL, - `highest_id` int(11) NOT NULL, - `latest_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `student_item_id` (`student_item_id`), - KEY `submissions_scoresummary_d65f9365` (`highest_id`), - KEY `submissions_scoresummary_1efb24d9` (`latest_id`), - CONSTRAINT `highest_id_refs_id_1bdc0a18` FOREIGN KEY (`highest_id`) REFERENCES `submissions_score` (`id`), - CONSTRAINT `latest_id_refs_id_1bdc0a18` FOREIGN KEY (`latest_id`) REFERENCES `submissions_score` (`id`), - CONSTRAINT `student_item_id_refs_id_bd51e768` FOREIGN KEY (`student_item_id`) REFERENCES `submissions_studentitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `submissions_studentitem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `submissions_studentitem` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `student_id` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - `item_id` varchar(255) NOT NULL, - `item_type` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `submissions_studentitem_course_id_6a6eccbdec6ffd0b_uniq` (`course_id`,`student_id`,`item_id`), - KEY `submissions_studentitem_42ff452e` (`student_id`), - KEY `submissions_studentitem_ff48d8e5` (`course_id`), - KEY `submissions_studentitem_67b70d25` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `submissions_submission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `submissions_submission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uuid` varchar(36) NOT NULL, - `student_item_id` int(11) NOT NULL, - `attempt_number` int(10) unsigned NOT NULL, - `submitted_at` datetime NOT NULL, - `created_at` datetime NOT NULL, - `raw_answer` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `submissions_submission_2bbc74ae` (`uuid`), - KEY `submissions_submission_fa84001` (`student_item_id`), - KEY `submissions_submission_4452d192` (`submitted_at`), - KEY `submissions_submission_3b1c9c31` (`created_at`), - CONSTRAINT `student_item_id_refs_id_b5cccc` FOREIGN KEY (`student_item_id`) REFERENCES `submissions_studentitem` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `survey_surveyanswer`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `survey_surveyanswer` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `form_id` int(11) NOT NULL, - `field_name` varchar(255) NOT NULL, - `field_value` varchar(1024) NOT NULL, - PRIMARY KEY (`id`), - KEY `survey_surveyanswer_fbfc09f1` (`user_id`), - KEY `survey_surveyanswer_1d0aabf2` (`form_id`), - KEY `survey_surveyanswer_7e1499` (`field_name`), - CONSTRAINT `form_id_refs_id_f4c79f29` FOREIGN KEY (`form_id`) REFERENCES `survey_surveyform` (`id`), - CONSTRAINT `user_id_refs_id_e0ad4b5e` 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 `survey_surveyform`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `survey_surveyform` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `name` varchar(255) NOT NULL, - `form` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `teams_courseteam`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `teams_courseteam` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `team_id` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `is_active` tinyint(1) NOT NULL, - `course_id` varchar(255) NOT NULL, - `topic_id` varchar(255) NOT NULL, - `date_created` datetime NOT NULL, - `description` varchar(300) NOT NULL, - `country` varchar(2) NOT NULL, - `language` varchar(16) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `team_id` (`team_id`), - KEY `teams_courseteam_ff48d8e5` (`course_id`), - KEY `teams_courseteam_57732028` (`topic_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `teams_courseteammembership`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `teams_courseteammembership` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `team_id` int(11) NOT NULL, - `date_joined` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `teams_courseteammembership_user_id_48efa8e8971947c3_uniq` (`user_id`,`team_id`), - KEY `teams_courseteammembership_fbfc09f1` (`user_id`), - KEY `teams_courseteammembership_fcf8ac47` (`team_id`), - CONSTRAINT `team_id_refs_id_679497a3` FOREIGN KEY (`team_id`) REFERENCES `teams_courseteam` (`id`), - CONSTRAINT `user_id_refs_id_abc442bf` 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 `track_trackinglog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `track_trackinglog` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `dtcreated` datetime NOT NULL, - `username` varchar(32) NOT NULL, - `ip` varchar(32) NOT NULL, - `event_source` varchar(32) NOT NULL, - `event_type` varchar(512) NOT NULL, - `event` longtext NOT NULL, - `agent` varchar(256) NOT NULL, - `page` varchar(512), - `time` datetime NOT NULL, - `host` varchar(64) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `user_api_usercoursetag`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_api_usercoursetag` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `key` varchar(255) NOT NULL, - `course_id` varchar(255) NOT NULL, - `value` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_api_usercoursetags_user_id_a734720a0483b08_uniq` (`user_id`,`course_id`,`key`), - KEY `user_api_usercoursetags_fbfc09f1` (`user_id`), - KEY `user_api_usercoursetags_45544485` (`key`), - KEY `user_api_usercoursetags_ff48d8e5` (`course_id`), - CONSTRAINT `user_id_refs_id_47a9a367` 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 `user_api_userorgtag`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_api_userorgtag` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `key` varchar(255) NOT NULL, - `org` varchar(255) NOT NULL, - `value` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_api_userorgtag_user_id_694f9e3322120c6f_uniq` (`user_id`,`org`,`key`), - KEY `user_api_userorgtag_user_id_694f9e3322120c6f` (`user_id`,`org`,`key`), - KEY `user_api_userorgtag_fbfc09f1` (`user_id`), - KEY `user_api_userorgtag_45544485` (`key`), - KEY `user_api_userorgtag_4f5f82e2` (`org`), - CONSTRAINT `user_id_refs_id_e54b717f` 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 `user_api_userpreference`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_api_userpreference` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `key` varchar(255) NOT NULL, - `value` longtext NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_api_userpreference_user_id_4e4942d73f760072_uniq` (`user_id`,`key`), - KEY `user_api_userpreference_fbfc09f1` (`user_id`), - KEY `user_api_userpreference_45544485` (`key`), - CONSTRAINT `user_id_refs_id_f3473b9e` 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 `util_ratelimitconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `util_ratelimitconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `util_ratelimitconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_76a26307` 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 `verify_student_incoursereverificationconfiguration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_incoursereverificationconfiguration` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `verify_student_incoursereverificationconfiguration_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_ab2dfc2a` 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 `verify_student_skippedreverification`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_skippedreverification` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `course_id` varchar(255) NOT NULL, - `checkpoint_id` int(11) NOT NULL, - `created_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `verify_student_skippedreverificat_user_id_1e8af5a5e735aa1a_uniq` (`user_id`,`course_id`), - KEY `verify_student_skippedreverification_fbfc09f1` (`user_id`), - KEY `verify_student_skippedreverification_ff48d8e5` (`course_id`), - KEY `verify_student_skippedreverification_a631e438` (`checkpoint_id`), - CONSTRAINT `checkpoint_id_refs_id_de8541b1` FOREIGN KEY (`checkpoint_id`) REFERENCES `verify_student_verificationcheckpoint` (`id`), - CONSTRAINT `user_id_refs_id_f26a5780` 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 `verify_student_softwaresecurephotoverification`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_softwaresecurephotoverification` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `status` varchar(100) NOT NULL, - `status_changed` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - `face_image_url` varchar(255) NOT NULL, - `photo_id_image_url` varchar(255) NOT NULL, - `receipt_id` varchar(255) NOT NULL, - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, - `submitted_at` datetime DEFAULT NULL, - `reviewing_user_id` int(11) DEFAULT NULL, - `reviewing_service` varchar(255) NOT NULL, - `error_msg` longtext NOT NULL, - `error_code` varchar(50) NOT NULL, - `photo_id_key` longtext NOT NULL, - `display` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `verify_student_softwaresecurephotoverification_fbfc09f1` (`user_id`), - KEY `verify_student_softwaresecurephotoverification_8713c555` (`receipt_id`), - KEY `verify_student_softwaresecurephotoverification_3b1c9c31` (`created_at`), - 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_35eebcb6` (`display`), - CONSTRAINT `reviewing_user_id_refs_id_d6ea4207` FOREIGN KEY (`reviewing_user_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `user_id_refs_id_d6ea4207` 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 `verify_student_verificationcheckpoint`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_verificationcheckpoint` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `course_id` varchar(255) NOT NULL, - `checkpoint_location` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `verify_student_verificationchec_course_id_2c6a1f5c22b4cc19_uniq` (`course_id`,`checkpoint_location`), - KEY `verify_student_verificationcheckpoint_ff48d8e5` (`course_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `verify_student_verificationcheckpoint_photo_verification`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_verificationcheckpoint_photo_verification` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `verificationcheckpoint_id` int(11) NOT NULL, - `softwaresecurephotoverification_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `verify_student_v_verificationcheckpoint_id_1df07f66c1a9271_uniq` (`verificationcheckpoint_id`,`softwaresecurephotoverification_id`), - KEY `verify_student_verificationcheckpoint_photo_verification_c30361a` (`verificationcheckpoint_id`), - KEY `verify_student_verificationcheckpoint_photo_verification_fdc8dba` (`softwaresecurephotoverification_id`), - CONSTRAINT `softwaresecurephotoverification_id_refs_id_5efb90e` FOREIGN KEY (`softwaresecurephotoverification_id`) REFERENCES `verify_student_softwaresecurephotoverification` (`id`), - CONSTRAINT `verificationcheckpoint_id_refs_id_9a387f43` FOREIGN KEY (`verificationcheckpoint_id`) REFERENCES `verify_student_verificationcheckpoint` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `verify_student_verificationstatus`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `verify_student_verificationstatus` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `checkpoint_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `status` varchar(32) NOT NULL, - `timestamp` datetime NOT NULL, - `response` longtext, - `error` longtext, - PRIMARY KEY (`id`), - KEY `verify_student_verificationstatus_a631e438` (`checkpoint_id`), - KEY `verify_student_verificationstatus_fbfc09f1` (`user_id`), - KEY `verify_student_verificationstatus_c9ad71dd` (`status`), - CONSTRAINT `checkpoint_id_refs_id_70d70b21` FOREIGN KEY (`checkpoint_id`) REFERENCES `verify_student_verificationcheckpoint` (`id`), - CONSTRAINT `user_id_refs_id_bfc6370` 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 `wiki_article`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_article` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `current_revision_id` int(11) DEFAULT NULL, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `owner_id` int(11) DEFAULT NULL, - `group_id` int(11) DEFAULT NULL, - `group_read` tinyint(1) NOT NULL, - `group_write` tinyint(1) NOT NULL, - `other_read` tinyint(1) NOT NULL, - `other_write` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `current_revision_id` (`current_revision_id`), - KEY `wiki_article_5d52dd10` (`owner_id`), - KEY `wiki_article_bda51c3c` (`group_id`), - CONSTRAINT `current_revision_id_refs_id_bafac304` FOREIGN KEY (`current_revision_id`) REFERENCES `wiki_articlerevision` (`id`), - CONSTRAINT `group_id_refs_id_108bfee4` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `owner_id_refs_id_9e14b583` FOREIGN KEY (`owner_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_articleforobject`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_articleforobject` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `article_id` int(11) NOT NULL, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `is_mptt` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `wiki_articleforobject_content_type_id_27c4cce189b3bcab_uniq` (`content_type_id`,`object_id`), - KEY `wiki_articleforobject_30525a19` (`article_id`), - KEY `wiki_articleforobject_e4470c6e` (`content_type_id`), - CONSTRAINT `article_id_refs_id_5099436` FOREIGN KEY (`article_id`) REFERENCES `wiki_article` (`id`), - CONSTRAINT `content_type_id_refs_id_37828764` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_articleplugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_articleplugin` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `article_id` int(11) NOT NULL, - `deleted` tinyint(1) NOT NULL, - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `wiki_articleplugin_30525a19` (`article_id`), - CONSTRAINT `article_id_refs_id_92c648ca` FOREIGN KEY (`article_id`) REFERENCES `wiki_article` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_articlerevision`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_articlerevision` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `revision_number` int(11) NOT NULL, - `user_message` longtext NOT NULL, - `automatic_log` longtext NOT NULL, - `ip_address` char(15) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `modified` datetime NOT NULL, - `created` datetime NOT NULL, - `previous_revision_id` int(11) DEFAULT NULL, - `deleted` tinyint(1) NOT NULL, - `locked` tinyint(1) NOT NULL, - `article_id` int(11) NOT NULL, - `content` longtext NOT NULL, - `title` varchar(512) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `wiki_articlerevision_article_id_4b4e7910c8e7b2d0_uniq` (`article_id`,`revision_number`), - KEY `wiki_articlerevision_fbfc09f1` (`user_id`), - KEY `wiki_articlerevision_49bc38cc` (`previous_revision_id`), - KEY `wiki_articlerevision_30525a19` (`article_id`), - CONSTRAINT `article_id_refs_id_5c88570a` FOREIGN KEY (`article_id`) REFERENCES `wiki_article` (`id`), - CONSTRAINT `previous_revision_id_refs_id_a951e36b` FOREIGN KEY (`previous_revision_id`) REFERENCES `wiki_articlerevision` (`id`), - CONSTRAINT `user_id_refs_id_fbb26714` 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 `wiki_articlesubscription`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_articlesubscription` ( - `subscription_ptr_id` int(11) NOT NULL, - `articleplugin_ptr_id` int(11) NOT NULL, - PRIMARY KEY (`articleplugin_ptr_id`), - UNIQUE KEY `subscription_ptr_id` (`subscription_ptr_id`), - CONSTRAINT `articleplugin_ptr_id_refs_id_cbce00e3` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`), - CONSTRAINT `subscription_ptr_id_refs_id_ae89f475` FOREIGN KEY (`subscription_ptr_id`) REFERENCES `notify_subscription` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_attachment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_attachment` ( - `reusableplugin_ptr_id` int(11) NOT NULL, - `current_revision_id` int(11) DEFAULT NULL, - `original_filename` varchar(256) DEFAULT NULL, - PRIMARY KEY (`reusableplugin_ptr_id`), - UNIQUE KEY `current_revision_id` (`current_revision_id`), - CONSTRAINT `current_revision_id_refs_id_2198feb4` FOREIGN KEY (`current_revision_id`) REFERENCES `wiki_attachmentrevision` (`id`), - CONSTRAINT `reusableplugin_ptr_id_refs_articleplugin_ptr_id_6644e87a` FOREIGN KEY (`reusableplugin_ptr_id`) REFERENCES `wiki_reusableplugin` (`articleplugin_ptr_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_attachmentrevision`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_attachmentrevision` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `revision_number` int(11) NOT NULL, - `user_message` longtext NOT NULL, - `automatic_log` longtext NOT NULL, - `ip_address` char(15) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `modified` datetime NOT NULL, - `created` datetime NOT NULL, - `previous_revision_id` int(11) DEFAULT NULL, - `deleted` tinyint(1) NOT NULL, - `locked` tinyint(1) NOT NULL, - `attachment_id` int(11) NOT NULL, - `file` varchar(100) NOT NULL, - `description` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `wiki_attachmentrevision_fbfc09f1` (`user_id`), - KEY `wiki_attachmentrevision_49bc38cc` (`previous_revision_id`), - KEY `wiki_attachmentrevision_edee6011` (`attachment_id`), - CONSTRAINT `attachment_id_refs_reusableplugin_ptr_id_640583da` FOREIGN KEY (`attachment_id`) REFERENCES `wiki_attachment` (`reusableplugin_ptr_id`), - CONSTRAINT `previous_revision_id_refs_id_41bbf5` FOREIGN KEY (`previous_revision_id`) REFERENCES `wiki_attachmentrevision` (`id`), - CONSTRAINT `user_id_refs_id_2eaca84c` 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 `wiki_image`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_image` ( - `revisionplugin_ptr_id` int(11) NOT NULL, - PRIMARY KEY (`revisionplugin_ptr_id`), - CONSTRAINT `revisionplugin_ptr_id_refs_articleplugin_ptr_id_fc42a0b1` FOREIGN KEY (`revisionplugin_ptr_id`) REFERENCES `wiki_revisionplugin` (`articleplugin_ptr_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_imagerevision`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_imagerevision` ( - `revisionpluginrevision_ptr_id` int(11) NOT NULL, - `image` varchar(2000), - `width` smallint(6), - `height` smallint(6), - PRIMARY KEY (`revisionpluginrevision_ptr_id`), - CONSTRAINT `revisionpluginrevision_ptr_id_refs_id_5b9fc791` FOREIGN KEY (`revisionpluginrevision_ptr_id`) REFERENCES `wiki_revisionpluginrevision` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_reusableplugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_reusableplugin` ( - `articleplugin_ptr_id` int(11) NOT NULL, - PRIMARY KEY (`articleplugin_ptr_id`), - CONSTRAINT `articleplugin_ptr_id_refs_id_4ca661fd` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_reusableplugin_articles`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_reusableplugin_articles` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `reusableplugin_id` int(11) NOT NULL, - `article_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `wiki_reusableplugin_art_reusableplugin_id_6e34ac94afa8f9f2_uniq` (`reusableplugin_id`,`article_id`), - KEY `wiki_reusableplugin_articles_28b0b358` (`reusableplugin_id`), - KEY `wiki_reusableplugin_articles_30525a19` (`article_id`), - CONSTRAINT `article_id_refs_id_2f51faad` FOREIGN KEY (`article_id`) REFERENCES `wiki_article` (`id`), - CONSTRAINT `reusableplugin_id_refs_articleplugin_ptr_id_44b45e30` FOREIGN KEY (`reusableplugin_id`) REFERENCES `wiki_reusableplugin` (`articleplugin_ptr_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_revisionplugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_revisionplugin` ( - `articleplugin_ptr_id` int(11) NOT NULL, - `current_revision_id` int(11), - PRIMARY KEY (`articleplugin_ptr_id`), - UNIQUE KEY `current_revision_id` (`current_revision_id`), - CONSTRAINT `articleplugin_ptr_id_refs_id_cac31401` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`), - CONSTRAINT `current_revision_id_refs_id_44938e26` FOREIGN KEY (`current_revision_id`) REFERENCES `wiki_revisionpluginrevision` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_revisionpluginrevision`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_revisionpluginrevision` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `revision_number` int(11) NOT NULL, - `user_message` longtext NOT NULL, - `automatic_log` longtext NOT NULL, - `ip_address` char(15) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `modified` datetime NOT NULL, - `created` datetime NOT NULL, - `previous_revision_id` int(11) DEFAULT NULL, - `deleted` tinyint(1) NOT NULL, - `locked` tinyint(1) NOT NULL, - `plugin_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `wiki_revisionpluginrevision_fbfc09f1` (`user_id`), - KEY `wiki_revisionpluginrevision_49bc38cc` (`previous_revision_id`), - KEY `wiki_revisionpluginrevision_2857ccbf` (`plugin_id`), - CONSTRAINT `plugin_id_refs_articleplugin_ptr_id_41bbc69c` FOREIGN KEY (`plugin_id`) REFERENCES `wiki_revisionplugin` (`articleplugin_ptr_id`), - CONSTRAINT `previous_revision_id_refs_id_78fffe43` FOREIGN KEY (`previous_revision_id`) REFERENCES `wiki_revisionpluginrevision` (`id`), - CONSTRAINT `user_id_refs_id_32d8f395` 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 `wiki_simpleplugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_simpleplugin` ( - `articleplugin_ptr_id` int(11) NOT NULL, - `article_revision_id` int(11) NOT NULL, - PRIMARY KEY (`articleplugin_ptr_id`), - KEY `wiki_simpleplugin_b3dc49fe` (`article_revision_id`), - CONSTRAINT `article_revision_id_refs_id_6df37b12` FOREIGN KEY (`article_revision_id`) REFERENCES `wiki_articlerevision` (`id`), - CONSTRAINT `articleplugin_ptr_id_refs_id_a25cbfd2` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `wiki_urlpath`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `wiki_urlpath` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `slug` varchar(50) DEFAULT NULL, - `site_id` int(11) NOT NULL, - `parent_id` int(11) DEFAULT NULL, - `lft` int(10) unsigned NOT NULL, - `rght` int(10) unsigned NOT NULL, - `tree_id` int(10) unsigned NOT NULL, - `level` int(10) unsigned NOT NULL, - `article_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `wiki_urlpath_site_id_124f6aa7b2cc9b82_uniq` (`site_id`,`parent_id`,`slug`), - KEY `wiki_urlpath_a951d5d6` (`slug`), - KEY `wiki_urlpath_6223029` (`site_id`), - KEY `wiki_urlpath_63f17a16` (`parent_id`), - KEY `wiki_urlpath_42b06ff6` (`lft`), - KEY `wiki_urlpath_91543e5a` (`rght`), - KEY `wiki_urlpath_efd07f28` (`tree_id`), - KEY `wiki_urlpath_2a8f42e8` (`level`), - KEY `wiki_urlpath_30525a19` (`article_id`), - CONSTRAINT `article_id_refs_id_971759c9` FOREIGN KEY (`article_id`) REFERENCES `wiki_article` (`id`), - CONSTRAINT `parent_id_refs_id_52d1e703` FOREIGN KEY (`parent_id`) REFERENCES `wiki_urlpath` (`id`), - CONSTRAINT `site_id_refs_id_f4bbaaa2` FOREIGN KEY (`site_id`) REFERENCES `django_site` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `workflow_assessmentworkflow`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `workflow_assessmentworkflow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `created` datetime NOT NULL, - `modified` datetime NOT NULL, - `status` varchar(100) NOT NULL, - `status_changed` datetime NOT NULL, - `submission_uuid` varchar(36) NOT NULL, - `uuid` varchar(36) NOT NULL, - `course_id` varchar(255) NOT NULL, - `item_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `submission_uuid` (`submission_uuid`), - UNIQUE KEY `uuid` (`uuid`), - KEY `workflow_assessmentworkflow_course_id_21b427c69fc666ad` (`course_id`,`item_id`,`status`), - KEY `workflow_assessmentworkflow_ff48d8e5` (`course_id`), - KEY `workflow_assessmentworkflow_67b70d25` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `workflow_assessmentworkflowcancellation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `workflow_assessmentworkflowcancellation` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `workflow_id` int(11) NOT NULL, - `comments` longtext NOT NULL, - `cancelled_by_id` varchar(40) NOT NULL, - `created_at` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `workflow_assessmentworkflowcancellation_26cddbc7` (`workflow_id`), - KEY `workflow_assessmentworkflowcancellation_8569167` (`cancelled_by_id`), - KEY `workflow_assessmentworkflowcancellation_3b1c9c31` (`created_at`), - CONSTRAINT `workflow_id_refs_id_9b9e066a` FOREIGN KEY (`workflow_id`) REFERENCES `workflow_assessmentworkflow` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `workflow_assessmentworkflowstep`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `workflow_assessmentworkflowstep` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `workflow_id` int(11) NOT NULL, - `name` varchar(20) NOT NULL, - `submitter_completed_at` datetime DEFAULT NULL, - `assessment_completed_at` datetime DEFAULT NULL, - `order_num` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `workflow_assessmentworkflowstep_26cddbc7` (`workflow_id`), - CONSTRAINT `workflow_id_refs_id_69d0b483` FOREIGN KEY (`workflow_id`) REFERENCES `workflow_assessmentworkflow` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `xblock_config_studioconfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `xblock_config_studioconfig` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `change_date` datetime NOT NULL, - `changed_by_id` int(11) DEFAULT NULL, - `enabled` tinyint(1) NOT NULL, - `disabled_blocks` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `xblock_config_studioconfig_16905482` (`changed_by_id`), - CONSTRAINT `changed_by_id_refs_id_6ef7f7d7` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - diff --git a/common/test/db_cache/lettuce.db b/common/test/db_cache/lettuce.db index 3bd9676090..e69de29bb2 100644 Binary files a/common/test/db_cache/lettuce.db and b/common/test/db_cache/lettuce.db differ diff --git a/conf/locale/ru/LC_MESSAGES/django.po b/conf/locale/ru/LC_MESSAGES/django.po index 0568bc3190..89d1e7883c 100644 --- a/conf/locale/ru/LC_MESSAGES/django.po +++ b/conf/locale/ru/LC_MESSAGES/django.po @@ -19663,8 +19663,8 @@ msgstr "" #: wiki/views/article.py #, python-format -msgid "The article %s is now set to display revision #%d" -msgstr "Отображается версия #%d статьи %s " +msgid "The article %(title)s is now set to display revision #%(revision_number)d" +msgstr "Отображается версия #%(revision_number)d статьи %(title)s " #: wiki/views/article.py msgid "New title" diff --git a/docs/en_us/enrollment_api/source/conf.py b/docs/en_us/enrollment_api/source/conf.py index b70c7549de..62367fc2bc 100644 --- a/docs/en_us/enrollment_api/source/conf.py +++ b/docs/en_us/enrollment_api/source/conf.py @@ -30,10 +30,6 @@ MOCK_MODULES = [ 'Location', 'opaque_keys.edx.locator', 'Locator', - 'south', - 'modelsinspector', - 'south.modelsinspector', - 'add_introspection_rules' ] for mod_name in MOCK_MODULES: diff --git a/docs/en_us/platform_api/source/conf.py b/docs/en_us/platform_api/source/conf.py index 4bcb92d096..73e37cd843 100644 --- a/docs/en_us/platform_api/source/conf.py +++ b/docs/en_us/platform_api/source/conf.py @@ -58,10 +58,6 @@ MOCK_MODULES = [ 'opaque_keys.edx.locations', 'SlashSeparatedCourseKey', 'Locator', - 'south', - 'modelsinspector', - 'south.modelsinspector', - 'add_introspection_rules', 'courseware', 'access', 'courseware.access', diff --git a/docs/shared/requirements.txt b/docs/shared/requirements.txt index 0e0b949de2..de66975c0a 100644 --- a/docs/shared/requirements.txt +++ b/docs/shared/requirements.txt @@ -50,7 +50,6 @@ PyYAML==3.10 requests==2.3.0 Shapely==1.2.16 sorl-thumbnail==12.3 -South==1.0.1 sympy==0.7.1 xmltodict==0.4.1 diff --git a/lms/djangoapps/branding/migrations/0001_initial.py b/lms/djangoapps/branding/migrations/0001_initial.py index 44d24c69ed..7b2b9d8362 100644 --- a/lms/djangoapps/branding/migrations/0001_initial.py +++ b/lms/djangoapps/branding/migrations/0001_initial.py @@ -1,74 +1,43 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'BrandingInfoConfig' - db.create_table('branding_brandinginfoconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('configuration', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('branding', ['BrandingInfoConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'BrandingInfoConfig' - db.delete_table('branding_brandinginfoconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'branding.brandinginfoconfig': { - 'Meta': {'object_name': 'BrandingInfoConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['branding'] + operations = [ + migrations.CreateModel( + name='BrandingApiConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='BrandingInfoConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('configuration', models.TextField(help_text=b'JSON data of Configuration for Video Branding.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/lms/djangoapps/branding/migrations/0002_auto__add_brandingapiconfig.py b/lms/djangoapps/branding/migrations/0002_auto__add_brandingapiconfig.py deleted file mode 100644 index ffa45652a6..0000000000 --- a/lms/djangoapps/branding/migrations/0002_auto__add_brandingapiconfig.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BrandingApiConfig' - db.create_table('branding_brandingapiconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('branding', ['BrandingApiConfig']) - - - def backwards(self, orm): - # Deleting model 'BrandingApiConfig' - db.delete_table('branding_brandingapiconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'branding.brandingapiconfig': { - 'Meta': {'object_name': 'BrandingApiConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'branding.brandinginfoconfig': { - 'Meta': {'object_name': 'BrandingInfoConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['branding'] diff --git a/lms/djangoapps/branding/models.py b/lms/djangoapps/branding/models.py index 67a51d4f26..1dbed47bae 100644 --- a/lms/djangoapps/branding/models.py +++ b/lms/djangoapps/branding/models.py @@ -24,6 +24,9 @@ class BrandingInfoConfig(ConfigurationModel): } } """ + class Meta(ConfigurationModel.Meta): + app_label = "branding" + configuration = TextField( help_text="JSON data of Configuration for Video Branding." ) @@ -54,4 +57,5 @@ class BrandingApiConfig(ConfigurationModel): When the flag is enabled, the api will returns the valid reponse. """ - pass + class Meta(ConfigurationModel.Meta): + app_label = "branding" diff --git a/lms/djangoapps/bulk_email/forms.py b/lms/djangoapps/bulk_email/forms.py index b864432457..6fdec1459f 100644 --- a/lms/djangoapps/bulk_email/forms.py +++ b/lms/djangoapps/bulk_email/forms.py @@ -78,6 +78,7 @@ class CourseAuthorizationAdminForm(forms.ModelForm): class Meta(object): model = CourseAuthorization + fields = '__all__' def clean_course_id(self): """Validate the course id""" diff --git a/lms/djangoapps/bulk_email/migrations/0001_initial.py b/lms/djangoapps/bulk_email/migrations/0001_initial.py index c3672a6de8..479a1b3a97 100644 --- a/lms/djangoapps/bulk_email/migrations/0001_initial.py +++ b/lms/djangoapps/bulk_email/migrations/0001_initial.py @@ -1,101 +1,62 @@ # -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseEmail' - db.create_table('bulk_email_courseemail', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sender', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['auth.User'], null=True, blank=True)), - ('hash', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), - ('subject', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('html_message', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('to', self.gf('django.db.models.fields.CharField')(default='myself', max_length=64)), - )) - db.send_create_signal('bulk_email', ['CourseEmail']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'Optout' - db.create_table('bulk_email_optout', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('email', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('bulk_email', ['Optout']) - - # Adding unique constraint on 'Optout', fields ['email', 'course_id'] - db.create_unique('bulk_email_optout', ['email', 'course_id']) - - def backwards(self, orm): - # Removing unique constraint on 'Optout', fields ['email', 'course_id'] - db.delete_unique('bulk_email_optout', ['email', 'course_id']) - - # Deleting model 'CourseEmail' - db.delete_table('bulk_email_courseemail') - - # Deleting model 'Optout' - db.delete_table('bulk_email_optout') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'to': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] + operations = [ + migrations.CreateModel( + name='CourseAuthorization', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), + ('email_enabled', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='CourseEmail', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('slug', models.CharField(max_length=128, db_index=True)), + ('subject', models.CharField(max_length=128, blank=True)), + ('html_message', models.TextField(null=True, blank=True)), + ('text_message', models.TextField(null=True, blank=True)), + ('created', models.DateTimeField(auto_now_add=True)), + ('modified', models.DateTimeField(auto_now=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('to_option', models.CharField(default=b'myself', max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'all', b'All')])), + ('template_name', models.CharField(max_length=255, null=True)), + ('from_addr', models.CharField(max_length=255, null=True)), + ('sender', models.ForeignKey(default=1, blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ], + ), + migrations.CreateModel( + name='CourseEmailTemplate', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('html_template', models.TextField(null=True, blank=True)), + ('plain_template', models.TextField(null=True, blank=True)), + ('name', models.CharField(max_length=255, unique=True, null=True, blank=True)), + ], + ), + migrations.CreateModel( + name='Optout', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)), + ], + ), + migrations.AlterUniqueTogether( + name='optout', + unique_together=set([('user', 'course_id')]), + ), + ] diff --git a/lms/djangoapps/bulk_email/migrations/0002_change_field_names.py b/lms/djangoapps/bulk_email/migrations/0002_change_field_names.py deleted file mode 100644 index 93fa33a544..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0002_change_field_names.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Renaming field 'CourseEmail.to' - db.rename_column('bulk_email_courseemail', 'to', 'to_option') - - # Renaming field 'CourseEmail.hash' - db.rename_column('bulk_email_courseemail', 'hash', 'slug') - - # Adding field 'CourseEmail.text_message' - db.add_column('bulk_email_courseemail', 'text_message', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - def backwards(self, orm): - # Renaming field 'CourseEmail.to_option' - db.rename_column('bulk_email_courseemail', 'to_option', 'to') - - # Renaming field 'CourseEmail.slug' - db.rename_column('bulk_email_courseemail', 'slug', 'hash') - - # Deleting field 'CourseEmail.text_message' - db.delete_column('bulk_email_courseemail', 'text_message') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('email', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0002_data__load_course_email_template.py b/lms/djangoapps/bulk_email/migrations/0002_data__load_course_email_template.py new file mode 100644 index 0000000000..fe5a40232d --- /dev/null +++ b/lms/djangoapps/bulk_email/migrations/0002_data__load_course_email_template.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.core.management import call_command +from django.db import migrations, models + +def forwards(apps, schema_editor): + """Load data from the fixture""" + CourseEmailTemplate = apps.get_model("bulk_email", "CourseEmailTemplate") + if not CourseEmailTemplate.objects.exists(): + call_command("loaddata", "course_email_template.json") + +def backwards(apps, schema_editor): + CourseEmailTemplate = apps.get_model("bulk_email", "CourseEmailTemplate") + CourseEmailTemplate.objects.all().delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('bulk_email', '0001_initial'), + ] + + operations = [ + migrations.RunPython(forwards, backwards), + ] diff --git a/lms/djangoapps/bulk_email/migrations/0003_add_optout_user.py b/lms/djangoapps/bulk_email/migrations/0003_add_optout_user.py deleted file mode 100644 index 1bf344f6e9..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0003_add_optout_user.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Optout.user' - db.add_column('bulk_email_optout', 'user', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True), - keep_default=False) - - # Removing unique constraint on 'Optout', fields ['course_id', 'email'] - db.delete_unique('bulk_email_optout', ['course_id', 'email']) - - # Adding unique constraint on 'Optout', fields ['course_id', 'user'] - db.create_unique('bulk_email_optout', ['course_id', 'user_id']) - - def backwards(self, orm): - - # Removing unique constraint on 'Optout', fields ['course_id', 'user'] - db.delete_unique('bulk_email_optout', ['course_id', 'user_id']) - - # Deleting field 'Optout.email' - db.delete_column('bulk_email_optout', 'user_id') - - # Creating unique constraint on 'Optout', fields ['course_id', 'email'] - db.create_unique('bulk_email_optout', ['course_id', 'email']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0004_migrate_optout_user.py b/lms/djangoapps/bulk_email/migrations/0004_migrate_optout_user.py deleted file mode 100644 index 6dd2129466..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0004_migrate_optout_user.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import DataMigration -from django.core.exceptions import ObjectDoesNotExist - - -class Migration(DataMigration): - - def forwards(self, orm): - - # forwards data migration to copy over existing emails to associated ids - if not db.dry_run: - for optout in orm.Optout.objects.all(): - try: - user = orm['auth.User'].objects.get(email=optout.email) - optout.user = user - optout.save() - except ObjectDoesNotExist: - # if user is not found (because they have already changed their email) - # then delete the optout, as it's no longer useful. - optout.delete() - - def backwards(self, orm): - - # backwards data migration to copy over emails of students to old email slot - if not db.dry_run: - for optout in orm.Optout.objects.all(): - if optout.user is not None: - optout.email = optout.user.email - optout.save() - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0005_remove_optout_email.py b/lms/djangoapps/bulk_email/migrations/0005_remove_optout_email.py deleted file mode 100644 index 3639d1e473..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0005_remove_optout_email.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Deleting field 'Optout.email' - db.delete_column('bulk_email_optout', 'email') - - def backwards(self, orm): - - # Adding field 'Optout.email' - db.add_column('bulk_email_optout', 'email', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0006_add_course_email_template.py b/lms/djangoapps/bulk_email/migrations/0006_add_course_email_template.py deleted file mode 100644 index 69ec3fe3b3..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0006_add_course_email_template.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseEmailTemplate' - db.create_table('bulk_email_courseemailtemplate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('html_template', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('plain_template', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('bulk_email', ['CourseEmailTemplate']) - - def backwards(self, orm): - # Deleting model 'CourseEmailTemplate' - db.delete_table('bulk_email_courseemailtemplate') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.courseemailtemplate': { - 'Meta': {'object_name': 'CourseEmailTemplate'}, - 'html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'plain_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0007_load_course_email_template.py b/lms/djangoapps/bulk_email/migrations/0007_load_course_email_template.py deleted file mode 100644 index 7ccaaf07f9..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0007_load_course_email_template.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -from south.v2 import DataMigration - - -class Migration(DataMigration): - - def forwards(self, orm): - "Load data from fixture." - from django.core.management import call_command - call_command("loaddata", "course_email_template.json") - - def backwards(self, orm): - "Perform a no-op to go backwards." - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.courseemailtemplate': { - 'Meta': {'object_name': 'CourseEmailTemplate'}, - 'html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'plain_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] - symmetrical = True diff --git a/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py b/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py deleted file mode 100644 index a24e48d6e5..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseAuthorization' - db.create_table('bulk_email_courseauthorization', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('email_enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('bulk_email', ['CourseAuthorization']) - - - def backwards(self, orm): - # Deleting model 'CourseAuthorization' - db.delete_table('bulk_email_courseauthorization') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseauthorization': { - 'Meta': {'object_name': 'CourseAuthorization'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'email_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.courseemailtemplate': { - 'Meta': {'object_name': 'CourseEmailTemplate'}, - 'html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'plain_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py b/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py deleted file mode 100644 index d4a329b727..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding unique constraint on 'CourseAuthorization', fields ['course_id'] - db.create_unique('bulk_email_courseauthorization', ['course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseAuthorization', fields ['course_id'] - db.delete_unique('bulk_email_courseauthorization', ['course_id']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseauthorization': { - 'Meta': {'object_name': 'CourseAuthorization'}, - 'course_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'email_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.courseemailtemplate': { - 'Meta': {'object_name': 'CourseEmailTemplate'}, - 'html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'plain_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py b/lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py deleted file mode 100644 index 3e55dfb226..0000000000 --- a/lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Optout.course_id' - db.alter_column('bulk_email_optout', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - # Adding field 'CourseEmail.template_name' - db.add_column('bulk_email_courseemail', 'template_name', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'CourseEmail.from_addr' - db.add_column('bulk_email_courseemail', 'from_addr', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Changing field 'CourseEmail.course_id' - db.alter_column('bulk_email_courseemail', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - # Adding field 'CourseEmailTemplate.name' - db.add_column('bulk_email_courseemailtemplate', 'name', - self.gf('django.db.models.fields.CharField')(max_length=255, unique=True, null=True), - keep_default=False) - - # Changing field 'CourseAuthorization.course_id' - db.alter_column('bulk_email_courseauthorization', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255)) - - def backwards(self, orm): - - # Changing field 'Optout.course_id' - db.alter_column('bulk_email_optout', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - # Deleting field 'CourseEmail.template_name' - db.delete_column('bulk_email_courseemail', 'template_name') - - # Deleting field 'CourseEmail.from_addr' - db.delete_column('bulk_email_courseemail', 'from_addr') - - # Changing field 'CourseEmail.course_id' - db.alter_column('bulk_email_courseemail', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - # Deleting field 'CourseEmailTemplate.name' - db.delete_column('bulk_email_courseemailtemplate', 'name') - - # Changing field 'CourseAuthorization.course_id' - db.alter_column('bulk_email_courseauthorization', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'bulk_email.courseauthorization': { - 'Meta': {'object_name': 'CourseAuthorization'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'email_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'bulk_email.courseemail': { - 'Meta': {'object_name': 'CourseEmail'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'from_addr': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'html_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'sender': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'text_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'to_option': ('django.db.models.fields.CharField', [], {'default': "'myself'", 'max_length': '64'}) - }, - 'bulk_email.courseemailtemplate': { - 'Meta': {'object_name': 'CourseEmailTemplate'}, - 'html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}), - 'plain_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'bulk_email.optout': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'Optout'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index 6fab5559d8..0c8347d819 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -45,6 +45,7 @@ class Email(models.Model): modified = models.DateTimeField(auto_now=True) class Meta(object): + app_label = "bulk_email" abstract = True @@ -52,6 +53,9 @@ class CourseEmail(Email): """ Stores information for an email to a course. """ + class Meta(object): + app_label = "bulk_email" + # Three options for sending that we provide from the instructor dashboard: # * Myself: This sends an email to the staff member that is composing the email. # @@ -80,13 +84,6 @@ class CourseEmail(Email): text_message=None, template_name=None, from_addr=None): """ Create an instance of CourseEmail. - - The CourseEmail.save_now method makes sure the CourseEmail entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # automatically generate the stripped version of the text from the HTML markup: if text_message is None: @@ -109,24 +106,10 @@ class CourseEmail(Email): template_name=template_name, from_addr=from_addr, ) - course_email.save_now() + course_email.save() return course_email - @transaction.autocommit - def save_now(self): - """ - Writes CourseEmail immediately, ensuring the transaction is committed. - - Autocommit annotation makes sure the database entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, this autocommit here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. - """ - self.save() - def get_template(self): """ Returns the corresponding CourseEmailTemplate for this CourseEmail. @@ -145,6 +128,7 @@ class Optout(models.Model): course_id = CourseKeyField(max_length=255, db_index=True) class Meta(object): + app_label = "bulk_email" unique_together = ('user', 'course_id') @@ -162,6 +146,9 @@ class CourseEmailTemplate(models.Model): The admin console interface disables add and delete operations. Validation is handled in the CourseEmailTemplateForm class. """ + class Meta(object): + app_label = "bulk_email" + html_template = models.TextField(null=True, blank=True) plain_template = models.TextField(null=True, blank=True) name = models.CharField(null=True, max_length=255, unique=True, blank=True) @@ -235,6 +222,9 @@ class CourseAuthorization(models.Model): """ Enable the course email feature on a course-by-course basis. """ + class Meta(object): + app_label = "bulk_email" + # The course that these features are attached to. course_id = CourseKeyField(max_length=255, db_index=True, unique=True) diff --git a/lms/djangoapps/ccx/migrations/0001_initial.py b/lms/djangoapps/ccx/migrations/0001_initial.py index 6ec2fe67ce..c13c74f996 100644 --- a/lms/djangoapps/ccx/migrations/0001_initial.py +++ b/lms/djangoapps/ccx/migrations/0001_initial.py @@ -1,136 +1,43 @@ # -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CustomCourseForEdX' - db.create_table('ccx_customcourseforedx', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('display_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('coach', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - )) - db.send_create_signal('ccx', ['CustomCourseForEdX']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'CcxMembership' - db.create_table('ccx_ccxmembership', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('ccx', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ccx.CustomCourseForEdX'])), - ('student', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('active', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('ccx', ['CcxMembership']) - - # Adding model 'CcxFutureMembership' - db.create_table('ccx_ccxfuturemembership', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('ccx', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ccx.CustomCourseForEdX'])), - ('email', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('auto_enroll', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('ccx', ['CcxFutureMembership']) - - # Adding model 'CcxFieldOverride' - db.create_table('ccx_ccxfieldoverride', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('ccx', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ccx.CustomCourseForEdX'])), - ('location', self.gf('xmodule_django.models.LocationKeyField')(max_length=255, db_index=True)), - ('field', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('value', self.gf('django.db.models.fields.TextField')(default='null')), - )) - db.send_create_signal('ccx', ['CcxFieldOverride']) - - # Adding unique constraint on 'CcxFieldOverride', fields ['ccx', 'location', 'field'] - db.create_unique('ccx_ccxfieldoverride', ['ccx_id', 'location', 'field']) - - def backwards(self, orm): - # Removing unique constraint on 'CcxFieldOverride', fields ['ccx', 'location', 'field'] - db.delete_unique('ccx_ccxfieldoverride', ['ccx_id', 'location', 'field']) - - # Deleting model 'CustomCourseForEdX' - db.delete_table('ccx_customcourseforedx') - - # Deleting model 'CcxMembership' - db.delete_table('ccx_ccxmembership') - - # Deleting model 'CcxFutureMembership' - db.delete_table('ccx_ccxfuturemembership') - - # Deleting model 'CcxFieldOverride' - db.delete_table('ccx_ccxfieldoverride') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'ccx.ccxfieldoverride': { - 'Meta': {'unique_together': "(('ccx', 'location', 'field'),)", 'object_name': 'CcxFieldOverride'}, - 'ccx': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ccx.CustomCourseForEdX']"}), - 'field': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'ccx.ccxfuturemembership': { - 'Meta': {'object_name': 'CcxFutureMembership'}, - 'auto_enroll': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'ccx': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ccx.CustomCourseForEdX']"}), - 'email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'ccx.ccxmembership': { - 'Meta': {'object_name': 'CcxMembership'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'ccx': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ccx.CustomCourseForEdX']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'ccx.customcourseforedx': { - 'Meta': {'object_name': 'CustomCourseForEdX'}, - 'coach': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['ccx'] + operations = [ + migrations.CreateModel( + name='CcxFieldOverride', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('location', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), + ('field', models.CharField(max_length=255)), + ('value', models.TextField(default=b'null')), + ], + ), + migrations.CreateModel( + name='CustomCourseForEdX', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('display_name', models.CharField(max_length=255)), + ('coach', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AddField( + model_name='ccxfieldoverride', + name='ccx', + field=models.ForeignKey(to='ccx.CustomCourseForEdX'), + ), + migrations.AlterUniqueTogether( + name='ccxfieldoverride', + unique_together=set([('ccx', 'location', 'field')]), + ), + ] diff --git a/lms/djangoapps/ccx/migrations/0002_convert_memberships.py b/lms/djangoapps/ccx/migrations/0002_convert_memberships.py deleted file mode 100644 index 4f595eb312..0000000000 --- a/lms/djangoapps/ccx/migrations/0002_convert_memberships.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models -from opaque_keys import InvalidKeyError - -class Migration(DataMigration): - - def forwards(self, orm): - "Convert CCX Memberships to Course Enrollments." - from ccx_keys.locator import CCXLocator - memberships = orm['ccx.CcxMembership'].objects.select_related('ccx', 'student').all() - for membership in memberships: - ccx = membership.ccx - try: - course_key = CCXLocator.from_course_locator(ccx.course_id, ccx.id) - enrollment, created = orm['student.CourseEnrollment'].objects.get_or_create( - user=membership.student, - course_id=course_key, - ) - except InvalidKeyError: - membership.delete() - - - def backwards(self, orm): - """In the future, here we will convert back CCX Course Enrollments to CCX - Memberships. - """ - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'ccx.ccxfieldoverride': { - 'Meta': {'unique_together': "(('ccx', 'location', 'field'),)", 'object_name': 'CcxFieldOverride'}, - 'ccx': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ccx.CustomCourseForEdX']"}), - 'field': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'ccx.customcourseforedx': { - 'Meta': {'object_name': 'CustomCourseForEdX'}, - 'coach': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'ccx.ccxmembership': { - 'Meta': {'object_name': 'CcxMembership'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': False}), - 'ccx': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ccx.CustomCourseForEdX']"}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'object_name': 'CourseEnrollment'}, - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': True}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100', 'default': '"honor"'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['ccx', 'ccx'] - symmetrical = True diff --git a/lms/djangoapps/ccx/models.py b/lms/djangoapps/ccx/models.py index 6fc68d5d50..2bb03f204c 100644 --- a/lms/djangoapps/ccx/models.py +++ b/lms/djangoapps/ccx/models.py @@ -25,6 +25,9 @@ class CustomCourseForEdX(models.Model): display_name = models.CharField(max_length=255) coach = models.ForeignKey(User, db_index=True) + class Meta(object): + app_label = 'ccx' + @lazy def course(self): """Return the CourseDescriptor of the course related to this CCX""" @@ -114,6 +117,7 @@ class CcxFieldOverride(models.Model): field = models.CharField(max_length=255) class Meta(object): + app_label = 'ccx' unique_together = (('ccx', 'location', 'field'),) value = models.TextField(default='null') diff --git a/lms/djangoapps/ccx/overrides.py b/lms/djangoapps/ccx/overrides.py index bf5aa34145..44838ecf08 100644 --- a/lms/djangoapps/ccx/overrides.py +++ b/lms/djangoapps/ccx/overrides.py @@ -13,7 +13,7 @@ from courseware.field_overrides import FieldOverrideProvider # pylint: disable= from opaque_keys.edx.keys import CourseKey, UsageKey from ccx_keys.locator import CCXLocator, CCXBlockUsageLocator -from .models import CcxFieldOverride, CustomCourseForEdX +from lms.djangoapps.ccx.models import CcxFieldOverride, CustomCourseForEdX log = logging.getLogger(__name__) @@ -125,7 +125,7 @@ def _get_overrides_for_ccx(ccx): return overrides_cache[ccx] -@transaction.commit_on_success +@transaction.atomic def override_field_for_ccx(ccx, block, name, value): """ Overrides a field for the `ccx`. `block` and `name` specify the block @@ -142,18 +142,15 @@ def override_field_for_ccx(ccx, block, name, value): override_has_changes = serialized_value != override.value if not override: - try: - override = CcxFieldOverride.objects.create( - ccx=ccx, - location=block.location, - field=name, - value=serialized_value - ) + override, created = CcxFieldOverride.objects.get_or_create( + ccx=ccx, + location=block.location, + field=name, + defaults={'value': serialized_value}, + ) + if created: _get_overrides_for_ccx(ccx).setdefault(block.location, {})[name + "_id"] = override.id - except IntegrityError: - transaction.commit() - kwargs = {'ccx': ccx, 'location': block.location, 'field': name} - override = CcxFieldOverride.objects.get(**kwargs) + else: override_has_changes = serialized_value != override.value if override_has_changes: diff --git a/lms/djangoapps/ccx/tasks.py b/lms/djangoapps/ccx/tasks.py index 10c8492c83..8a95c4cdbf 100644 --- a/lms/djangoapps/ccx/tasks.py +++ b/lms/djangoapps/ccx/tasks.py @@ -11,7 +11,7 @@ from ccx_keys.locator import CCXLocator from xmodule.modulestore.django import SignalHandler from lms import CELERY_APP -from .models import CustomCourseForEdX +from lms.djangoapps.ccx.models import CustomCourseForEdX log = logging.getLogger("edx.ccx") diff --git a/lms/djangoapps/ccx/tests/factories.py b/lms/djangoapps/ccx/tests/factories.py index 19ead87224..4d2d554457 100644 --- a/lms/djangoapps/ccx/tests/factories.py +++ b/lms/djangoapps/ccx/tests/factories.py @@ -4,7 +4,7 @@ Dummy factories for tests from factory import SubFactory from factory.django import DjangoModelFactory from student.tests.factories import UserFactory -from ccx.models import CustomCourseForEdX # pylint: disable=import-error +from lms.djangoapps.ccx.models import CustomCourseForEdX class CcxFactory(DjangoModelFactory): # pylint: disable=missing-docstring diff --git a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py index 161037a50f..98ca36138d 100644 --- a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py +++ b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py @@ -14,7 +14,7 @@ from xmodule.modulestore.tests.django_utils import ( from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from ..models import CustomCourseForEdX +from lms.djangoapps.ccx.models import CustomCourseForEdX class TestCCXModulestoreWrapper(SharedModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index ed0f7a2782..6a63c9825a 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -11,7 +11,7 @@ from courseware.views import progress # pylint: disable=import-error from courseware.field_overrides import OverrideFieldData from datetime import datetime from django.conf import settings -from django.core.cache import get_cache +from django.core.cache import caches from django.test.client import RequestFactory from django.test.utils import override_settings from edxmako.middleware import MakoMiddleware # pylint: disable=import-error @@ -27,7 +27,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, \ from xmodule.modulestore.tests.factories import check_mongo_calls_range, CourseFactory, check_sum_of_calls from xmodule.modulestore.tests.utils import ProceduralCourseTestMixin from ccx_keys.locator import CCXLocator -from ccx.tests.factories import CcxFactory +from lms.djangoapps.ccx.tests.factories import CcxFactory @attr('shard_1') @@ -161,7 +161,7 @@ class FieldOverridePerformanceTestCase(ProceduralCourseTestMixin, with self.settings(MODULESTORE_BRANCH='published-only'): # Clear all caches before measuring for cache in settings.CACHES: - get_cache(cache).clear() + caches[cache].clear() # Refill the metadata inheritance cache modulestore().get_course(self.course.id, depth=None) @@ -214,24 +214,24 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase): TEST_DATA = { # (providers, course_width, enable_ccx, view_as_ccx): # of sql queries, # of mongo queries, # of xblocks - ('no_overrides', 1, True, False): (24, 6, 13), - ('no_overrides', 2, True, False): (69, 6, 84), - ('no_overrides', 3, True, False): (264, 6, 335), - ('ccx', 1, True, False): (24, 6, 13), - ('ccx', 2, True, False): (69, 6, 84), - ('ccx', 3, True, False): (264, 6, 335), - ('ccx', 1, True, True): (24, 6, 13), - ('ccx', 2, True, True): (69, 6, 84), - ('ccx', 3, True, True): (264, 6, 335), - ('no_overrides', 1, False, False): (24, 6, 13), - ('no_overrides', 2, False, False): (69, 6, 84), - ('no_overrides', 3, False, False): (264, 6, 335), - ('ccx', 1, False, False): (24, 6, 13), - ('ccx', 2, False, False): (69, 6, 84), - ('ccx', 3, False, False): (264, 6, 335), - ('ccx', 1, False, True): (24, 6, 13), - ('ccx', 2, False, True): (69, 6, 84), - ('ccx', 3, False, True): (264, 6, 335), + ('no_overrides', 1, True, False): (48, 6, 13), + ('no_overrides', 2, True, False): (135, 6, 84), + ('no_overrides', 3, True, False): (480, 6, 335), + ('ccx', 1, True, False): (48, 6, 13), + ('ccx', 2, True, False): (135, 6, 84), + ('ccx', 3, True, False): (480, 6, 335), + ('ccx', 1, True, True): (48, 6, 13), + ('ccx', 2, True, True): (135, 6, 84), + ('ccx', 3, True, True): (480, 6, 335), + ('no_overrides', 1, False, False): (48, 6, 13), + ('no_overrides', 2, False, False): (135, 6, 84), + ('no_overrides', 3, False, False): (480, 6, 335), + ('ccx', 1, False, False): (48, 6, 13), + ('ccx', 2, False, False): (135, 6, 84), + ('ccx', 3, False, False): (480, 6, 335), + ('ccx', 1, False, True): (48, 6, 13), + ('ccx', 2, False, True): (135, 6, 84), + ('ccx', 3, False, True): (480, 6, 335), } @@ -243,22 +243,22 @@ class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase): __test__ = True TEST_DATA = { - ('no_overrides', 1, True, False): (24, 4, 9), - ('no_overrides', 2, True, False): (69, 19, 54), - ('no_overrides', 3, True, False): (264, 84, 215), - ('ccx', 1, True, False): (24, 4, 9), - ('ccx', 2, True, False): (69, 19, 54), - ('ccx', 3, True, False): (264, 84, 215), - ('ccx', 1, True, True): (26, 4, 13), - ('ccx', 2, True, True): (71, 19, 84), - ('ccx', 3, True, True): (266, 84, 335), - ('no_overrides', 1, False, False): (24, 4, 9), - ('no_overrides', 2, False, False): (69, 19, 54), - ('no_overrides', 3, False, False): (264, 84, 215), - ('ccx', 1, False, False): (24, 4, 9), - ('ccx', 2, False, False): (69, 19, 54), - ('ccx', 3, False, False): (264, 84, 215), - ('ccx', 1, False, True): (24, 4, 9), - ('ccx', 2, False, True): (69, 19, 54), - ('ccx', 3, False, True): (264, 84, 215), + ('no_overrides', 1, True, False): (48, 4, 9), + ('no_overrides', 2, True, False): (135, 19, 54), + ('no_overrides', 3, True, False): (480, 84, 215), + ('ccx', 1, True, False): (48, 4, 9), + ('ccx', 2, True, False): (135, 19, 54), + ('ccx', 3, True, False): (480, 84, 215), + ('ccx', 1, True, True): (50, 4, 13), + ('ccx', 2, True, True): (137, 19, 84), + ('ccx', 3, True, True): (482, 84, 335), + ('no_overrides', 1, False, False): (48, 4, 9), + ('no_overrides', 2, False, False): (135, 19, 54), + ('no_overrides', 3, False, False): (480, 84, 215), + ('ccx', 1, False, False): (48, 4, 9), + ('ccx', 2, False, False): (135, 19, 54), + ('ccx', 3, False, False): (480, 84, 215), + ('ccx', 1, False, True): (48, 4, 9), + ('ccx', 2, False, True): (135, 19, 54), + ('ccx', 3, False, True): (480, 84, 215), } diff --git a/lms/djangoapps/ccx/tests/test_overrides.py b/lms/djangoapps/ccx/tests/test_overrides.py index d88a8d4c35..4b1be35e39 100644 --- a/lms/djangoapps/ccx/tests/test_overrides.py +++ b/lms/djangoapps/ccx/tests/test_overrides.py @@ -17,10 +17,10 @@ from xmodule.modulestore.tests.django_utils import ( TEST_DATA_SPLIT_MODULESTORE) from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from ..models import CustomCourseForEdX -from ..overrides import override_field_for_ccx +from lms.djangoapps.ccx.models import CustomCourseForEdX +from lms.djangoapps.ccx.overrides import override_field_for_ccx -from .test_views import flatten, iter_blocks +from lms.djangoapps.ccx.tests.test_views import flatten, iter_blocks @attr('shard_1') @@ -95,7 +95,12 @@ class TestFieldOverrides(ModuleStoreTestCase): """ ccx_start = datetime.datetime(2014, 12, 25, 00, 00, tzinfo=pytz.UTC) chapter = self.ccx.course.get_children()[0] - with self.assertNumQueries(1): + # One outer SAVEPOINT/RELEASE SAVEPOINT pair around everything caused by the + # transaction.atomic decorator wrapping override_field_for_ccx. + # One SELECT and one INSERT. + # One inner SAVEPOINT/RELEASE SAVEPOINT pair around the INSERT caused by the + # transaction.atomic down in Django's get_or_create()/_create_object_from_params(). + with self.assertNumQueries(6): override_field_for_ccx(self.ccx, chapter, 'start', ccx_start) def test_override_num_queries_update_existing_field(self): @@ -106,7 +111,7 @@ class TestFieldOverrides(ModuleStoreTestCase): new_ccx_start = datetime.datetime(2015, 12, 25, 00, 00, tzinfo=pytz.UTC) chapter = self.ccx.course.get_children()[0] override_field_for_ccx(self.ccx, chapter, 'start', ccx_start) - with self.assertNumQueries(2): + with self.assertNumQueries(3): override_field_for_ccx(self.ccx, chapter, 'start', new_ccx_start) def test_override_num_queries_field_value_not_changed(self): @@ -116,7 +121,7 @@ class TestFieldOverrides(ModuleStoreTestCase): ccx_start = datetime.datetime(2014, 12, 25, 00, 00, tzinfo=pytz.UTC) chapter = self.ccx.course.get_children()[0] override_field_for_ccx(self.ccx, chapter, 'start', ccx_start) - with self.assertNumQueries(0): + with self.assertNumQueries(2): # 2 savepoints override_field_for_ccx(self.ccx, chapter, 'start', ccx_start) def test_overriden_field_access_produces_no_extra_queries(self): @@ -125,7 +130,12 @@ class TestFieldOverrides(ModuleStoreTestCase): """ ccx_start = datetime.datetime(2014, 12, 25, 00, 00, tzinfo=pytz.UTC) chapter = self.ccx.course.get_children()[0] - with self.assertNumQueries(1): + # One outer SAVEPOINT/RELEASE SAVEPOINT pair around everything caused by the + # transaction.atomic decorator wrapping override_field_for_ccx. + # One SELECT and one INSERT. + # One inner SAVEPOINT/RELEASE SAVEPOINT pair around the INSERT caused by the + # transaction.atomic down in Django's get_or_create()/_create_object_from_params(). + with self.assertNumQueries(6): override_field_for_ccx(self.ccx, chapter, 'start', ccx_start) def test_override_is_inherited(self): diff --git a/lms/djangoapps/ccx/tests/test_tasks.py b/lms/djangoapps/ccx/tests/test_tasks.py index c1f568b4e2..be8d0097ef 100644 --- a/lms/djangoapps/ccx/tests/test_tasks.py +++ b/lms/djangoapps/ccx/tests/test_tasks.py @@ -4,9 +4,7 @@ Tests for celery tasks defined in tasks module from mock_django import mock_signal_receiver -from ccx.tests.factories import ( # pylint: disable=import-error - CcxFactory, -) +from lms.djangoapps.ccx.tests.factories import CcxFactory from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error AdminFactory, @@ -21,7 +19,7 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi from ccx_keys.locator import CCXLocator -from ..tasks import send_ccx_course_published +from lms.djangoapps.ccx.tasks import send_ccx_course_published class TestSendCCXCoursePublished(ModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/tests/test_utils.py b/lms/djangoapps/ccx/tests/test_utils.py index 01c0bc7cc0..cd592185e7 100644 --- a/lms/djangoapps/ccx/tests/test_utils.py +++ b/lms/djangoapps/ccx/tests/test_utils.py @@ -3,9 +3,7 @@ test utils """ from nose.plugins.attrib import attr -from ccx.tests.factories import ( # pylint: disable=import-error - CcxFactory, -) +from lms.djangoapps.ccx.tests.factories import CcxFactory from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error AdminFactory, @@ -33,7 +31,7 @@ class TestGetCCXFromCCXLocator(ModuleStoreTestCase): def call_fut(self, course_id): """call the function under test in this test case""" - from ccx.utils import get_ccx_from_ccx_locator + from lms.djangoapps.ccx.utils import get_ccx_from_ccx_locator return get_ccx_from_ccx_locator(course_id) def test_non_ccx_locator(self): diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 04f1a8bbed..3d1dfa2d49 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -49,13 +49,9 @@ from xmodule.modulestore.tests.factories import ( ) from ccx_keys.locator import CCXLocator -from ..models import ( - CustomCourseForEdX, -) -from ..overrides import get_override_for_ccx, override_field_for_ccx -from .factories import ( - CcxFactory, -) +from lms.djangoapps.ccx.models import CustomCourseForEdX +from lms.djangoapps.ccx.overrides import get_override_for_ccx, override_field_for_ccx +from lms.djangoapps.ccx.tests.factories import CcxFactory def intercept_renderer(path, context): diff --git a/lms/djangoapps/ccx/utils.py b/lms/djangoapps/ccx/utils.py index 8cbcb8ece1..8b9d80d919 100644 --- a/lms/djangoapps/ccx/utils.py +++ b/lms/djangoapps/ccx/utils.py @@ -5,7 +5,7 @@ Does not include any access control, be sure to check access before calling. """ import logging -from .models import CustomCourseForEdX +from lms.djangoapps.ccx.models import CustomCourseForEdX log = logging.getLogger("edx.ccx") diff --git a/lms/djangoapps/ccx/views.py b/lms/djangoapps/ccx/views.py index 804391c6a6..9fbfd3e8ff 100644 --- a/lms/djangoapps/ccx/views.py +++ b/lms/djangoapps/ccx/views.py @@ -21,6 +21,7 @@ from django.http import ( from django.contrib import messages from django.core.exceptions import ValidationError from django.core.validators import validate_email +from django.db import transaction from django.http import Http404 from django.shortcuts import redirect from django.utils.translation import ugettext as _ @@ -49,8 +50,9 @@ from instructor.enrollment import ( unenroll_email, get_email_params, ) -from .models import CustomCourseForEdX -from .overrides import ( + +from lms.djangoapps.ccx.models import CustomCourseForEdX +from lms.djangoapps.ccx.overrides import ( get_override_for_ccx, override_field_for_ccx, clear_ccx_field_info_from_ccx_map, @@ -416,7 +418,7 @@ def ccx_schedule(request, course, ccx=None): # pylint: disable=unused-argument schedule = get_ccx_schedule(course, ccx) json_schedule = json.dumps(schedule, indent=4) - return HttpResponse(json_schedule, mimetype='application/json') + return HttpResponse(json_schedule, content_type='application/json') def get_valid_student_email(identifier): @@ -572,6 +574,8 @@ def prep_course_for_grading(course, request): course.set_grading_policy(course.grading_policy) +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @cache_control(no_cache=True, no_store=True, must_revalidate=True) @coach_dashboard def ccx_gradebook(request, course, ccx=None): @@ -598,6 +602,8 @@ def ccx_gradebook(request, course, ccx=None): }) +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @cache_control(no_cache=True, no_store=True, must_revalidate=True) @coach_dashboard def ccx_grades_csv(request, course, ccx=None): diff --git a/lms/djangoapps/certificates/admin.py b/lms/djangoapps/certificates/admin.py index f878e083b2..54eccb0ac8 100644 --- a/lms/djangoapps/certificates/admin.py +++ b/lms/djangoapps/certificates/admin.py @@ -30,6 +30,7 @@ class CertificateTemplateForm(forms.ModelForm): class Meta(object): model = CertificateTemplate + fields = '__all__' class CertificateTemplateAdmin(admin.ModelAdmin): diff --git a/lms/djangoapps/certificates/migrations/0001_added_generatedcertificates.py b/lms/djangoapps/certificates/migrations/0001_added_generatedcertificates.py deleted file mode 100644 index 094a439085..0000000000 --- a/lms/djangoapps/certificates/migrations/0001_added_generatedcertificates.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'GeneratedCertificate' - db.create_table('certificates_generatedcertificate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32)), - )) - db.send_create_signal('certificates', ['GeneratedCertificate']) - - def backwards(self, orm): - # Deleting model 'GeneratedCertificate' - db.delete_table('certificates_generatedcertificate') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0001_initial.py b/lms/djangoapps/certificates/migrations/0001_initial.py new file mode 100644 index 0000000000..79801ff8b9 --- /dev/null +++ b/lms/djangoapps/certificates/migrations/0001_initial.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import certificates.models +import model_utils.fields +import xmodule_django.models +import django_extensions.db.fields +import django_extensions.db.fields.json +import django.db.models.deletion +import django.utils.timezone +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='BadgeAssertion', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), + ('mode', models.CharField(max_length=100)), + ('data', django_extensions.db.fields.json.JSONField()), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='BadgeImageConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('mode', models.CharField(help_text='The course mode for this badge image. For example, "verified" or "honor".', unique=True, max_length=125)), + ('icon', models.ImageField(help_text='Badge images must be square PNG files. The file size should be under 250KB.', upload_to=b'badges', validators=[certificates.models.validate_badge_image])), + ('default', models.BooleanField(default=False, help_text='Set this value to True if you want this image to be the default image for any course modes that do not have a specified badge image. You can have only one default image.')), + ], + ), + migrations.CreateModel( + name='CertificateGenerationConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='CertificateGenerationCourseSetting', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('enabled', models.BooleanField(default=False)), + ], + options={ + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='CertificateHtmlViewConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('configuration', models.TextField(help_text=b'Certificate HTML View Parameters (JSON)')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='CertificateTemplate', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('name', models.CharField(help_text='Name of template.', max_length=255)), + ('description', models.CharField(help_text='Description and/or admin notes.', max_length=255, null=True, blank=True)), + ('template', models.TextField(help_text='Django template HTML.')), + ('organization_id', models.IntegerField(help_text='Organization of template.', null=True, db_index=True, blank=True)), + ('course_key', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, null=True, blank=True)), + ('mode', models.CharField(default=b'honor', choices=[(b'verified', b'verified'), (b'honor', b'honor'), (b'audit', b'audit'), (b'professional', b'professional'), (b'no-id-professional', b'no-id-professional')], max_length=125, blank=True, help_text='The course mode for this template.', null=True)), + ('is_active', models.BooleanField(default=False, help_text='On/Off switch.')), + ], + options={ + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='CertificateTemplateAsset', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('description', models.CharField(help_text='Description of the asset.', max_length=255, null=True, blank=True)), + ('asset', models.FileField(help_text='Asset file. It could be an image or css file.', max_length=255, upload_to=certificates.models.template_assets_path)), + ], + options={ + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='CertificateWhitelist', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), + ('whitelist', models.BooleanField(default=0)), + ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')), + ('notes', models.TextField(default=None, null=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ExampleCertificate', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('description', models.CharField(help_text="A human-readable description of the example certificate. For example, 'verified' or 'honor' to differentiate between two types of certificates.", max_length=255)), + ('uuid', models.CharField(default=certificates.models._make_uuid, help_text='A unique identifier for the example certificate. This is used when we receive a response from the queue to determine which example certificate was processed.', unique=True, max_length=255, db_index=True)), + ('access_key', models.CharField(default=certificates.models._make_uuid, help_text='An access key for the example certificate. This is used when we receive a response from the queue to validate that the sender is the same entity we asked to generate the certificate.', max_length=255, db_index=True)), + ('full_name', models.CharField(default='John Do\xeb', help_text='The full name that will appear on the certificate.', max_length=255)), + ('template', models.CharField(help_text='The template file to use when generating the certificate.', max_length=255)), + ('status', models.CharField(default=b'started', help_text='The status of the example certificate.', max_length=255, choices=[(b'started', b'Started'), (b'success', b'Success'), (b'error', b'Error')])), + ('error_reason', models.TextField(default=None, help_text='The reason an error occurred during certificate generation.', null=True)), + ('download_url', models.CharField(default=None, max_length=255, null=True, help_text='The download URL for the generated certificate.')), + ], + ), + migrations.CreateModel( + name='ExampleCertificateSet', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ], + options={ + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='GeneratedCertificate', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), + ('verify_uuid', models.CharField(default=b'', max_length=32, blank=True)), + ('download_uuid', models.CharField(default=b'', max_length=32, blank=True)), + ('download_url', models.CharField(default=b'', max_length=128, blank=True)), + ('grade', models.CharField(default=b'', max_length=5, blank=True)), + ('key', models.CharField(default=b'', max_length=32, blank=True)), + ('distinction', models.BooleanField(default=False)), + ('status', models.CharField(default=b'unavailable', max_length=32)), + ('mode', models.CharField(default=b'honor', max_length=32, choices=[(b'verified', b'verified'), (b'honor', b'honor'), (b'audit', b'audit'), (b'professional', b'professional'), (b'no-id-professional', b'no-id-professional')])), + ('name', models.CharField(max_length=255, blank=True)), + ('created_date', models.DateTimeField(auto_now_add=True)), + ('modified_date', models.DateTimeField(auto_now=True)), + ('error_reason', models.CharField(default=b'', max_length=512, blank=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AddField( + model_name='examplecertificate', + name='example_cert_set', + field=models.ForeignKey(to='certificates.ExampleCertificateSet'), + ), + migrations.AlterUniqueTogether( + name='certificatetemplate', + unique_together=set([('organization_id', 'course_key', 'mode')]), + ), + migrations.AlterUniqueTogether( + name='generatedcertificate', + unique_together=set([('user', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='badgeassertion', + unique_together=set([('course_id', 'user', 'mode')]), + ), + ] diff --git a/lms/djangoapps/certificates/migrations/0002_auto__add_field_generatedcertificate_download_url.py b/lms/djangoapps/certificates/migrations/0002_auto__add_field_generatedcertificate_download_url.py deleted file mode 100644 index 0019a0c491..0000000000 --- a/lms/djangoapps/certificates/migrations/0002_auto__add_field_generatedcertificate_download_url.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GeneratedCertificate.download_url' - db.add_column('certificates_generatedcertificate', 'download_url', - self.gf('django.db.models.fields.CharField')(max_length=128, null=True), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'GeneratedCertificate.download_url' - db.delete_column('certificates_generatedcertificate', 'download_url') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0002_data__certificatehtmlviewconfiguration_data.py b/lms/djangoapps/certificates/migrations/0002_data__certificatehtmlviewconfiguration_data.py new file mode 100644 index 0000000000..3d508eb6d6 --- /dev/null +++ b/lms/djangoapps/certificates/migrations/0002_data__certificatehtmlviewconfiguration_data.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +from __future__ import unicode_literals +import json + +# Converted from the original South migration 0020_certificatehtmlviewconfiguration_data.py + +from django.db import migrations, models + + +def forwards(apps, schema_editor): + """ + Bootstraps the HTML view template with some default configuration parameters + """ + config = { + "default": { + "accomplishment_class_append": "accomplishment-certificate", + "platform_name": "Your Platform Name Here", + "company_about_url": "http://www.example.com/about-us", + "company_privacy_url": "http://www.example.com/privacy-policy", + "company_tos_url": "http://www.example.com/terms-service", + "company_verified_certificate_url": "http://www.example.com/verified-certificate", + "logo_src": "/static/certificates/images/logo.png", + "logo_url": "http://www.example.com" + }, + "honor": { + "certificate_type": "Honor Code", + "certificate_title": "Certificate of Achievement", + }, + "verified": { + "certificate_type": "Verified", + "certificate_title": "Verified Certificate of Achievement", + } + } + certificate_html_view_configuration_model = apps.get_model("certificates", "CertificateHtmlViewConfiguration") + db_alias = schema_editor.connection.alias + + objects = certificate_html_view_configuration_model.objects.using(db_alias) + if not objects.exists(): + objects.create( + configuration=json.dumps(config), + enabled=False, + ) + +def backwards(apps, schema_editor): + """ + Rolling back to zero-state, so remove all currently-defined configurations + """ + certificate_html_view_configuration_model = apps.get_model("certificates", "CertificateHtmlViewConfiguration") + db_alias = schema_editor.connection.alias + + certificate_html_view_configuration_model.objects.using(db_alias).all().delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('certificates', '0001_initial'), + ] + + operations = [ + migrations.RunPython(forwards, backwards) + ] diff --git a/lms/djangoapps/certificates/migrations/0003_auto__add_field_generatedcertificate_enabled.py b/lms/djangoapps/certificates/migrations/0003_auto__add_field_generatedcertificate_enabled.py deleted file mode 100644 index 8c1150f497..0000000000 --- a/lms/djangoapps/certificates/migrations/0003_auto__add_field_generatedcertificate_enabled.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GeneratedCertificate.enabled' - db.add_column('certificates_generatedcertificate', 'enabled', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'GeneratedCertificate.enabled' - db.delete_column('certificates_generatedcertificate', 'enabled') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0003_data__default_modes.py b/lms/djangoapps/certificates/migrations/0003_data__default_modes.py new file mode 100644 index 0000000000..0fab96af09 --- /dev/null +++ b/lms/djangoapps/certificates/migrations/0003_data__default_modes.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +# Converted from the original South migration 0002_default_rate_limit_config.py + +from django.db import migrations, models +from django.conf import settings +from django.core.files import File + +def forwards(apps, schema_editor): + """Add default modes""" + BadgeImageConfiguration = apps.get_model("certificates", "BadgeImageConfiguration") + db_alias = schema_editor.connection.alias + + objects = BadgeImageConfiguration.objects.using(db_alias) + if not objects.exists(): + for mode in ['honor', 'verified', 'professional']: + conf = objects.create(mode=mode) + file_name = '{0}{1}'.format(mode, '.png') + conf.icon.save( + 'badges/{}'.format(file_name), + File(open(settings.PROJECT_ROOT / 'static' / 'images' / 'default-badges' / file_name)) + ) + + conf.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('certificates', '0002_data__certificatehtmlviewconfiguration_data'), + ] + + operations = [ + migrations.RunPython(forwards) + ] diff --git a/lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py b/lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py deleted file mode 100644 index 6d7b41a1d6..0000000000 --- a/lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py +++ /dev/null @@ -1,107 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'GeneratedCertificate.graded_certificate_id' - db.add_column('certificates_generatedcertificate', 'graded_certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32, null=True), keep_default=False) - - # Adding field 'GeneratedCertificate.graded_download_url' - db.add_column('certificates_generatedcertificate', 'graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True), keep_default=False) - - # Adding field 'GeneratedCertificate.grade' - db.add_column('certificates_generatedcertificate', 'grade', self.gf('django.db.models.fields.CharField')(max_length=5, null=True), keep_default=False) - - def backwards(self, orm): - - # Deleting field 'GeneratedCertificate.graded_certificate_id' - db.delete_column('certificates_generatedcertificate', 'graded_certificate_id') - - # Deleting field 'GeneratedCertificate.graded_download_url' - db.delete_column('certificates_generatedcertificate', 'graded_download_url') - - # Deleting field 'GeneratedCertificate.grade' - db.delete_column('certificates_generatedcertificate', 'grade') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py b/lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py deleted file mode 100644 index 9b3660a5b3..0000000000 --- a/lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py +++ /dev/null @@ -1,96 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'GeneratedCertificate.name' - db.add_column('certificates_generatedcertificate', 'name', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), keep_default=False) - - def backwards(self, orm): - - # Deleting field 'GeneratedCertificate.name' - db.delete_column('certificates_generatedcertificate', 'name') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0006_auto__chg_field_generatedcertificate_certificate_id.py b/lms/djangoapps/certificates/migrations/0006_auto__chg_field_generatedcertificate_certificate_id.py deleted file mode 100644 index 947f0f967d..0000000000 --- a/lms/djangoapps/certificates/migrations/0006_auto__chg_field_generatedcertificate_certificate_id.py +++ /dev/null @@ -1,96 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'GeneratedCertificate.certificate_id' - db.alter_column('certificates_generatedcertificate', 'certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)) - - def backwards(self, orm): - - # Changing field 'GeneratedCertificate.certificate_id' - db.alter_column('certificates_generatedcertificate', 'certificate_id', self.gf('django.db.models.fields.CharField')(default=None, max_length=32)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0007_auto__add_revokedcertificate.py b/lms/djangoapps/certificates/migrations/0007_auto__add_revokedcertificate.py deleted file mode 100644 index 03f2548679..0000000000 --- a/lms/djangoapps/certificates/migrations/0007_auto__add_revokedcertificate.py +++ /dev/null @@ -1,121 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'RevokedCertificate' - db.create_table('certificates_revokedcertificate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('explanation', self.gf('django.db.models.fields.TextField')(blank=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('certificate_id', self.gf('django.db.models.fields.CharField')(default=None, max_length=32, null=True)), - ('graded_certificate_id', self.gf('django.db.models.fields.CharField')(default=None, max_length=32, null=True)), - ('download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)), - ('graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)), - ('grade', self.gf('django.db.models.fields.CharField')(max_length=5, null=True)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['RevokedCertificate']) - - def backwards(self, orm): - - # Deleting model 'RevokedCertificate' - db.delete_table('certificates_revokedcertificate') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.revokedcertificate': { - 'Meta': {'object_name': 'RevokedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'explanation': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add.py b/lms/djangoapps/certificates/migrations/0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add.py deleted file mode 100644 index 872804d286..0000000000 --- a/lms/djangoapps/certificates/migrations/0008_auto__del_revokedcertificate__del_field_generatedcertificate_name__add.py +++ /dev/null @@ -1,163 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'RevokedCertificate' - db.delete_table('certificates_revokedcertificate') - - # Deleting field 'GeneratedCertificate.name' - db.delete_column('certificates_generatedcertificate', 'name') - - # Adding field 'GeneratedCertificate.course_id' - db.add_column('certificates_generatedcertificate', 'course_id', - self.gf('django.db.models.fields.CharField')(default=False, max_length=255), - keep_default=False) - - # Adding field 'GeneratedCertificate.key' - db.add_column('certificates_generatedcertificate', 'key', - self.gf('django.db.models.fields.CharField')(default=False, max_length=32), - keep_default=False) - - - # Changing field 'GeneratedCertificate.grade' - db.alter_column('certificates_generatedcertificate', 'grade', self.gf('django.db.models.fields.CharField')(max_length=5)) - - # Changing field 'GeneratedCertificate.certificate_id' - db.alter_column('certificates_generatedcertificate', 'certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32)) - - # Changing field 'GeneratedCertificate.download_url' - db.alter_column('certificates_generatedcertificate', 'download_url', self.gf('django.db.models.fields.CharField')(max_length=128)) - - # Changing field 'GeneratedCertificate.graded_download_url' - db.alter_column('certificates_generatedcertificate', 'graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128)) - - # Changing field 'GeneratedCertificate.graded_certificate_id' - db.alter_column('certificates_generatedcertificate', 'graded_certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32)) - - def backwards(self, orm): - # Adding model 'RevokedCertificate' - db.create_table('certificates_revokedcertificate', ( - ('grade', self.gf('django.db.models.fields.CharField')(max_length=5, null=True)), - ('certificate_id', self.gf('django.db.models.fields.CharField')(default=None, max_length=32, null=True)), - ('explanation', self.gf('django.db.models.fields.TextField')(blank=True)), - ('graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)), - ('graded_certificate_id', self.gf('django.db.models.fields.CharField')(default=None, max_length=32, null=True)), - )) - db.send_create_signal('certificates', ['RevokedCertificate']) - - # Adding field 'GeneratedCertificate.name' - db.add_column('certificates_generatedcertificate', 'name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), - keep_default=False) - - # Deleting field 'GeneratedCertificate.course_id' - db.delete_column('certificates_generatedcertificate', 'course_id') - - # Deleting field 'GeneratedCertificate.key' - db.delete_column('certificates_generatedcertificate', 'key') - - - # Changing field 'GeneratedCertificate.grade' - db.alter_column('certificates_generatedcertificate', 'grade', self.gf('django.db.models.fields.CharField')(max_length=5, null=True)) - - # Changing field 'GeneratedCertificate.certificate_id' - db.alter_column('certificates_generatedcertificate', 'certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)) - - # Changing field 'GeneratedCertificate.download_url' - db.alter_column('certificates_generatedcertificate', 'download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)) - - # Changing field 'GeneratedCertificate.graded_download_url' - db.alter_column('certificates_generatedcertificate', 'graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True)) - - # Changing field 'GeneratedCertificate.graded_certificate_id' - db.alter_column('certificates_generatedcertificate', 'graded_certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '128'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '5'}), - 'graded_certificate_id': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '32'}), - 'graded_download_url': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '128'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge.py b/lms/djangoapps/certificates/migrations/0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge.py deleted file mode 100644 index 2ff1434314..0000000000 --- a/lms/djangoapps/certificates/migrations/0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'GeneratedCertificate.graded_download_url' - db.delete_column('certificates_generatedcertificate', 'graded_download_url') - - # Deleting field 'GeneratedCertificate.graded_certificate_id' - db.delete_column('certificates_generatedcertificate', 'graded_certificate_id') - - # Adding field 'GeneratedCertificate.distinction' - db.add_column('certificates_generatedcertificate', 'distinction', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding unique constraint on 'GeneratedCertificate', fields ['course_id', 'user'] - db.create_unique('certificates_generatedcertificate', ['course_id', 'user_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'GeneratedCertificate', fields ['course_id', 'user'] - db.delete_unique('certificates_generatedcertificate', ['course_id', 'user_id']) - - # Adding field 'GeneratedCertificate.graded_download_url' - db.add_column('certificates_generatedcertificate', 'graded_download_url', - self.gf('django.db.models.fields.CharField')(default=False, max_length=128), - keep_default=False) - - # Adding field 'GeneratedCertificate.graded_certificate_id' - db.add_column('certificates_generatedcertificate', 'graded_certificate_id', - self.gf('django.db.models.fields.CharField')(default=False, max_length=32), - keep_default=False) - - # Deleting field 'GeneratedCertificate.distinction' - db.delete_column('certificates_generatedcertificate', 'distinction') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '32'}), - 'course_id': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '255'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '128'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '5'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': 'False', 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py b/lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py deleted file mode 100644 index a41e58cc3b..0000000000 --- a/lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'GeneratedCertificate.enabled' - db.delete_column('certificates_generatedcertificate', 'enabled') - - # Adding field 'GeneratedCertificate.status' - db.add_column('certificates_generatedcertificate', 'status', - self.gf('django.db.models.fields.CharField')(default='unavailable', max_length=32), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'GeneratedCertificate.enabled' - db.add_column('certificates_generatedcertificate', 'enabled', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Deleting field 'GeneratedCertificate.status' - db.delete_column('certificates_generatedcertificate', 'status') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'certificate_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py b/lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py deleted file mode 100644 index 155839a82f..0000000000 --- a/lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'GeneratedCertificate.certificate_id' - db.delete_column('certificates_generatedcertificate', 'certificate_id') - - # Adding field 'GeneratedCertificate.verify_uuid' - db.add_column('certificates_generatedcertificate', 'verify_uuid', - self.gf('django.db.models.fields.CharField')(default='', max_length=32, blank=True), - keep_default=False) - - # Adding field 'GeneratedCertificate.download_uuid' - db.add_column('certificates_generatedcertificate', 'download_uuid', - self.gf('django.db.models.fields.CharField')(default='', max_length=32, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'GeneratedCertificate.certificate_id' - db.add_column('certificates_generatedcertificate', 'certificate_id', - self.gf('django.db.models.fields.CharField')(default='', max_length=32, blank=True), - keep_default=False) - - # Deleting field 'GeneratedCertificate.verify_uuid' - db.delete_column('certificates_generatedcertificate', 'verify_uuid') - - # Deleting field 'GeneratedCertificate.download_uuid' - db.delete_column('certificates_generatedcertificate', 'download_uuid') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0012_auto__add_field_generatedcertificate_name__add_field_generatedcertific.py b/lms/djangoapps/certificates/migrations/0012_auto__add_field_generatedcertificate_name__add_field_generatedcertific.py deleted file mode 100644 index 9261654ec8..0000000000 --- a/lms/djangoapps/certificates/migrations/0012_auto__add_field_generatedcertificate_name__add_field_generatedcertific.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GeneratedCertificate.name' - db.add_column('certificates_generatedcertificate', 'name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), - keep_default=False) - - # Adding field 'GeneratedCertificate.created_date' - db.add_column('certificates_generatedcertificate', 'created_date', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, auto_now_add=True, blank=True), - keep_default=False) - - # Adding field 'GeneratedCertificate.modified_date' - db.add_column('certificates_generatedcertificate', 'modified_date', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, auto_now=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'GeneratedCertificate.name' - db.delete_column('certificates_generatedcertificate', 'name') - - # Deleting field 'GeneratedCertificate.created_date' - db.delete_column('certificates_generatedcertificate', 'created_date') - - # Deleting field 'GeneratedCertificate.modified_date' - db.delete_column('certificates_generatedcertificate', 'modified_date') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0013_auto__add_field_generatedcertificate_error_reason.py b/lms/djangoapps/certificates/migrations/0013_auto__add_field_generatedcertificate_error_reason.py deleted file mode 100644 index 6031c8055b..0000000000 --- a/lms/djangoapps/certificates/migrations/0013_auto__add_field_generatedcertificate_error_reason.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GeneratedCertificate.error_reason' - db.add_column('certificates_generatedcertificate', 'error_reason', - self.gf('django.db.models.fields.CharField')(default='', max_length=512, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'GeneratedCertificate.error_reason' - db.delete_column('certificates_generatedcertificate', 'error_reason') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0014_adding_whitelist.py b/lms/djangoapps/certificates/migrations/0014_adding_whitelist.py deleted file mode 100644 index 0aafea4067..0000000000 --- a/lms/djangoapps/certificates/migrations/0014_adding_whitelist.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CertificateWhitelist' - db.create_table('certificates_certificatewhitelist', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True)), - ('whitelist', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['CertificateWhitelist']) - - - def backwards(self, orm): - # Deleting model 'CertificateWhitelist' - db.delete_table('certificates_certificatewhitelist') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py b/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py deleted file mode 100644 index 4423f4e226..0000000000 --- a/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GeneratedCertificate.mode' - db.add_column('certificates_generatedcertificate', 'mode', - self.gf('django.db.models.fields.CharField')(default='honor', max_length=32), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'GeneratedCertificate.mode' - db.delete_column('certificates_generatedcertificate', 'mode') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0016_change_course_key_fields.py b/lms/djangoapps/certificates/migrations/0016_change_course_key_fields.py deleted file mode 100644 index 6893750903..0000000000 --- a/lms/djangoapps/certificates/migrations/0016_change_course_key_fields.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'GeneratedCertificate.course_id' - db.alter_column('certificates_generatedcertificate', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - # Changing field 'CertificateWhitelist.course_id' - db.alter_column('certificates_certificatewhitelist', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - def backwards(self, orm): - - # Changing field 'GeneratedCertificate.course_id' - db.alter_column('certificates_generatedcertificate', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - # Changing field 'CertificateWhitelist.course_id' - db.alter_column('certificates_certificatewhitelist', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0017_auto__add_certificategenerationconfiguration.py b/lms/djangoapps/certificates/migrations/0017_auto__add_certificategenerationconfiguration.py deleted file mode 100644 index 5bf618a49d..0000000000 --- a/lms/djangoapps/certificates/migrations/0017_auto__add_certificategenerationconfiguration.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CertificateGenerationConfiguration' - db.create_table('certificates_certificategenerationconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['CertificateGenerationConfiguration']) - - def backwards(self, orm): - # Deleting model 'CertificateGenerationConfiguration' - db.delete_table('certificates_certificategenerationconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0018_add_example_cert_models.py b/lms/djangoapps/certificates/migrations/0018_add_example_cert_models.py deleted file mode 100644 index 372f45fd16..0000000000 --- a/lms/djangoapps/certificates/migrations/0018_add_example_cert_models.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CertificateGenerationCourseSetting' - db.create_table('certificates_certificategenerationcoursesetting', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['CertificateGenerationCourseSetting']) - - # Adding model 'ExampleCertificate' - db.create_table('certificates_examplecertificate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('example_cert_set', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['certificates.ExampleCertificateSet'])), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('uuid', self.gf('django.db.models.fields.CharField')(default='2017ea093523484cb355fac9c3e7a22b', unique=True, max_length=255, db_index=True)), - ('access_key', self.gf('django.db.models.fields.CharField')(default='8dc842be46484291a65b9ea34c3a8af8', max_length=255, db_index=True)), - ('full_name', self.gf('django.db.models.fields.CharField')(default=u'John Do\xeb', max_length=255)), - ('template', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('status', self.gf('django.db.models.fields.CharField')(default='started', max_length=255)), - ('error_reason', self.gf('django.db.models.fields.TextField')(default=None, null=True)), - ('download_url', self.gf('django.db.models.fields.CharField')(default=None, max_length=255, null=True)), - )) - db.create_index('certificates_examplecertificate', ['uuid', 'access_key']) - db.send_create_signal('certificates', ['ExampleCertificate']) - - # Adding model 'ExampleCertificateSet' - db.create_table('certificates_examplecertificateset', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - )) - db.send_create_signal('certificates', ['ExampleCertificateSet']) - - def backwards(self, orm): - # Deleting model 'CertificateGenerationCourseSetting' - db.delete_table('certificates_certificategenerationcoursesetting') - - # Deleting model 'ExampleCertificate' - db.delete_table('certificates_examplecertificate') - - # Deleting model 'ExampleCertificateSet' - db.delete_table('certificates_examplecertificateset') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'616e8368b9b2458b8ef8217713275322'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'f38e7389280d4776907ebf96ac728bac'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0019_auto__add_certificatehtmlviewconfiguration.py b/lms/djangoapps/certificates/migrations/0019_auto__add_certificatehtmlviewconfiguration.py deleted file mode 100644 index fe5d4b9a4b..0000000000 --- a/lms/djangoapps/certificates/migrations/0019_auto__add_certificatehtmlviewconfiguration.py +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CertificateHtmlViewConfiguration' - db.create_table('certificates_certificatehtmlviewconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('configuration', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('certificates', ['CertificateHtmlViewConfiguration']) - - def backwards(self, orm): - # Deleting model 'CertificateHtmlViewConfiguration' - db.delete_table('certificates_certificatehtmlviewconfiguration') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/migrations/0020_certificatehtmlviewconfiguration_data.py b/lms/djangoapps/certificates/migrations/0020_certificatehtmlviewconfiguration_data.py deleted file mode 100644 index 5ba8142ec3..0000000000 --- a/lms/djangoapps/certificates/migrations/0020_certificatehtmlviewconfiguration_data.py +++ /dev/null @@ -1,156 +0,0 @@ -# -*- coding: utf-8 -*- -import json -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - - -class Migration(DataMigration): - - def forwards(self, orm): - """ - Bootstraps the HTML view template with some default configuration parameters - """ - config = { - "default": { - "accomplishment_class_append": "accomplishment-certificate", - "platform_name": "Your Platform Name Here", - "company_about_url": "http://www.example.com/about-us", - "company_privacy_url": "http://www.example.com/privacy-policy", - "company_tos_url": "http://www.example.com/terms-service", - "company_verified_certificate_url": "http://www.example.com/verified-certificate", - "logo_src": "/static/certificates/images/logo.png", - "logo_url": "http://www.example.com" - }, - "honor": { - "certificate_type": "Honor Code", - "certificate_title": "Certificate of Achievement", - }, - "verified": { - "certificate_type": "Verified", - "certificate_title": "Verified Certificate of Achievement", - } - } - orm.CertificateHtmlViewConfiguration.objects.create( - configuration=json.dumps(config), - enabled=False, - ) - - def backwards(self, orm): - """ - Rolling back to zero-state, so remove all currently-defined configurations - """ - orm.CertificateHtmlViewConfiguration.objects.all().delete() - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'0836d966ec2047e18114969f89ee5270'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'558539cc3a114c48a1cc404a73d4cfcd'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] - symmetrical = True diff --git a/lms/djangoapps/certificates/migrations/0021_auto__add_badgeassertion__add_unique_badgeassertion_course_id_user__ad.py b/lms/djangoapps/certificates/migrations/0021_auto__add_badgeassertion__add_unique_badgeassertion_course_id_user__ad.py deleted file mode 100644 index 90dd7a0cba..0000000000 --- a/lms/djangoapps/certificates/migrations/0021_auto__add_badgeassertion__add_unique_badgeassertion_course_id_user__ad.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BadgeAssertion' - db.create_table('certificates_badgeassertion', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(default=None, max_length=255, blank=True)), - ('mode', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('data', self.gf('django.db.models.fields.TextField')(default='{}')), - )) - db.send_create_signal('certificates', ['BadgeAssertion']) - - # Adding unique constraint on 'BadgeAssertion', fields ['course_id', 'user'] - db.create_unique('certificates_badgeassertion', ['course_id', 'user_id']) - - # Adding model 'BadgeImageConfiguration' - db.create_table('certificates_badgeimageconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('mode', self.gf('django.db.models.fields.CharField')(unique=True, max_length=125)), - ('icon', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), - ('default', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['BadgeImageConfiguration']) - - - def backwards(self, orm): - # Removing unique constraint on 'BadgeAssertion', fields ['course_id', 'user'] - db.delete_unique('certificates_badgeassertion', ['course_id', 'user_id']) - - # Deleting model 'BadgeAssertion' - db.delete_table('certificates_badgeassertion') - - # Deleting model 'BadgeImageConfiguration' - db.delete_table('certificates_badgeimageconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.badgeassertion': { - 'Meta': {'unique_together': "(('course_id', 'user'),)", 'object_name': 'BadgeAssertion'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'data': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.badgeimageconfiguration': { - 'Meta': {'object_name': 'BadgeImageConfiguration'}, - 'default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '125'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'fa917079f0aa4f969e92bd8722d082c6'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'ac948bae296c4d54a87bdd3e6c177adf'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] \ No newline at end of file diff --git a/lms/djangoapps/certificates/migrations/0022_default_modes.py b/lms/djangoapps/certificates/migrations/0022_default_modes.py deleted file mode 100644 index 10d6334b04..0000000000 --- a/lms/djangoapps/certificates/migrations/0022_default_modes.py +++ /dev/null @@ -1,152 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models -from django.core.files import File -from django.conf import settings - - -class Migration(DataMigration): - - def forwards(self, orm): - """Add default modes""" - for mode in ['honor', 'verified', 'professional']: - conf = orm.BadgeImageConfiguration() - conf.mode = mode - file_name = mode + '.png' - conf.icon.save( - 'badges/{}'.format(file_name), - File(open(settings.PROJECT_ROOT / 'static' / 'images' / 'default-badges' / file_name)) - ) - conf.save() - - def backwards(self, orm): - """Do nothing, assumptions too dangerous.""" - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.badgeassertion': { - 'Meta': {'unique_together': "(('course_id', 'user'),)", 'object_name': 'BadgeAssertion'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'data': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.badgeimageconfiguration': { - 'Meta': {'object_name': 'BadgeImageConfiguration'}, - 'default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '125'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'6712301c558d4f41a0491bb12c9ab688'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'86d042630fdf4efcb8e705baad30c89f'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] - symmetrical = True diff --git a/lms/djangoapps/certificates/migrations/0023_auto__del_unique_badgeassertion_course_id_user__add_unique_badgeassert.py b/lms/djangoapps/certificates/migrations/0023_auto__del_unique_badgeassertion_course_id_user__add_unique_badgeassert.py deleted file mode 100644 index 66035e395c..0000000000 --- a/lms/djangoapps/certificates/migrations/0023_auto__del_unique_badgeassertion_course_id_user__add_unique_badgeassert.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'BadgeAssertion', fields ['course_id', 'user'] - db.delete_unique('certificates_badgeassertion', ['course_id', 'user_id']) - - # Adding unique constraint on 'BadgeAssertion', fields ['course_id', 'user', 'mode'] - db.create_unique('certificates_badgeassertion', ['course_id', 'user_id', 'mode']) - - - def backwards(self, orm): - # Removing unique constraint on 'BadgeAssertion', fields ['course_id', 'user', 'mode'] - db.delete_unique('certificates_badgeassertion', ['course_id', 'user_id', 'mode']) - - # Adding unique constraint on 'BadgeAssertion', fields ['course_id', 'user'] - db.create_unique('certificates_badgeassertion', ['course_id', 'user_id']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.badgeassertion': { - 'Meta': {'unique_together': "(('course_id', 'user', 'mode'),)", 'object_name': 'BadgeAssertion'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'data': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.badgeimageconfiguration': { - 'Meta': {'object_name': 'BadgeImageConfiguration'}, - 'default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '125'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'25c5af67da3d47039aa8b00b3a929fa9'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'88190407a2f14c429a7b5336e3fb0189'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] \ No newline at end of file diff --git a/lms/djangoapps/certificates/migrations/0024_auto__add_certificatetemplate__add_unique_certificatetemplate_organiza.py b/lms/djangoapps/certificates/migrations/0024_auto__add_certificatetemplate__add_unique_certificatetemplate_organiza.py deleted file mode 100644 index 006342f6e7..0000000000 --- a/lms/djangoapps/certificates/migrations/0024_auto__add_certificatetemplate__add_unique_certificatetemplate_organiza.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'CertificateTemplate' - db.create_table('certificates_certificatetemplate', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('template', self.gf('django.db.models.fields.TextField')()), - ('organization_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(db_index=True, max_length=255, null=True, blank=True)), - ('mode', self.gf('django.db.models.fields.CharField')(default='honor', max_length=125, null=True, blank=True)), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('certificates', ['CertificateTemplate']) - - # Adding unique constraint on 'CertificateTemplate', fields ['organization_id', 'course_key', 'mode'] - db.create_unique('certificates_certificatetemplate', ['organization_id', 'course_key', 'mode']) - - # Adding model 'CertificateTemplateAsset' - db.create_table('certificates_certificatetemplateasset', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('asset', self.gf('django.db.models.fields.files.FileField')(max_length=255)), - )) - db.send_create_signal('certificates', ['CertificateTemplateAsset']) - - - def backwards(self, orm): - # Removing unique constraint on 'CertificateTemplate', fields ['organization_id', 'course_key', 'mode'] - db.delete_unique('certificates_certificatetemplate', ['organization_id', 'course_key', 'mode']) - - # Deleting model 'CertificateTemplate' - db.delete_table('certificates_certificatetemplate') - - # Deleting model 'CertificateTemplateAsset' - db.delete_table('certificates_certificatetemplateasset') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.badgeassertion': { - 'Meta': {'unique_together': "(('course_id', 'user', 'mode'),)", 'object_name': 'BadgeAssertion'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'data': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.badgeimageconfiguration': { - 'Meta': {'object_name': 'BadgeImageConfiguration'}, - 'default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '125'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatetemplate': { - 'Meta': {'unique_together': "(('organization_id', 'course_key', 'mode'),)", 'object_name': 'CertificateTemplate'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '125', 'null': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'organization_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'template': ('django.db.models.fields.TextField', [], {}) - }, - 'certificates.certificatetemplateasset': { - 'Meta': {'object_name': 'CertificateTemplateAsset'}, - 'asset': ('django.db.models.fields.files.FileField', [], {'max_length': '255'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'f14d7721cd154a57a4fb52b9d4b4bc75'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'789810b9a54b4dd5bae3feec5b4e9fdb'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] \ No newline at end of file diff --git a/lms/djangoapps/certificates/migrations/0025_auto__add_field_certificatewhitelist_created__add_field_certificatewhi.py b/lms/djangoapps/certificates/migrations/0025_auto__add_field_certificatewhitelist_created__add_field_certificatewhi.py deleted file mode 100644 index cb1ec5b863..0000000000 --- a/lms/djangoapps/certificates/migrations/0025_auto__add_field_certificatewhitelist_created__add_field_certificatewhi.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CertificateWhitelist.created' - db.add_column('certificates_certificatewhitelist', 'created', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True), - keep_default=False) - - # Adding field 'CertificateWhitelist.notes' - db.add_column('certificates_certificatewhitelist', 'notes', - self.gf('django.db.models.fields.TextField')(default=None, null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CertificateWhitelist.created' - db.delete_column('certificates_certificatewhitelist', 'created') - - # Deleting field 'CertificateWhitelist.notes' - db.delete_column('certificates_certificatewhitelist', 'notes') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'certificates.badgeassertion': { - 'Meta': {'unique_together': "(('course_id', 'user', 'mode'),)", 'object_name': 'BadgeAssertion'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'data': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'certificates.badgeimageconfiguration': { - 'Meta': {'object_name': 'BadgeImageConfiguration'}, - 'default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '125'}) - }, - 'certificates.certificategenerationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateGenerationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificategenerationcoursesetting': { - 'Meta': {'object_name': 'CertificateGenerationCourseSetting'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatehtmlviewconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'CertificateHtmlViewConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'configuration': ('django.db.models.fields.TextField', [], {}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'certificates.certificatetemplate': { - 'Meta': {'unique_together': "(('organization_id', 'course_key', 'mode'),)", 'object_name': 'CertificateTemplate'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '125', 'null': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'organization_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'template': ('django.db.models.fields.TextField', [], {}) - }, - 'certificates.certificatetemplateasset': { - 'Meta': {'object_name': 'CertificateTemplateAsset'}, - 'asset': ('django.db.models.fields.files.FileField', [], {'max_length': '255'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.certificatewhitelist': { - 'Meta': {'object_name': 'CertificateWhitelist'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notes': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'whitelist': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'certificates.examplecertificate': { - 'Meta': {'object_name': 'ExampleCertificate'}, - 'access_key': ('django.db.models.fields.CharField', [], {'default': "'7c97c3537f944135b53a6d44ad8774b8'", 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), - 'error_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), - 'example_cert_set': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['certificates.ExampleCertificateSet']"}), - 'full_name': ('django.db.models.fields.CharField', [], {'default': "u'John Do\\xeb'", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '255'}), - 'template': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uuid': ('django.db.models.fields.CharField', [], {'default': "'82a6c6ad7a624746910b0dc584d950e0'", 'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'certificates.examplecertificateset': { - 'Meta': {'object_name': 'ExampleCertificateSet'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'certificates.generatedcertificate': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'GeneratedCertificate'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'default': 'None', 'max_length': '255', 'blank': 'True'}), - 'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}), - 'distinction': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'download_url': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), - 'download_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'error_reason': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '512', 'blank': 'True'}), - 'grade': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '32'}), - 'modified_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'unavailable'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'verify_uuid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['certificates'] \ No newline at end of file diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index a9b516b4a3..7bc6095742 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -104,6 +104,8 @@ class CertificateWhitelist(models.Model): embargoed country restriction list (allow_certificate set to False in userprofile). """ + class Meta(object): + app_label = "certificates" objects = NoneToEmptyManager() @@ -166,14 +168,13 @@ class GeneratedCertificate(models.Model): status = models.CharField(max_length=32, default='unavailable') mode = models.CharField(max_length=32, choices=MODES, default=MODES.honor) name = models.CharField(blank=True, max_length=255) - created_date = models.DateTimeField( - auto_now_add=True, default=datetime.now) - modified_date = models.DateTimeField( - auto_now=True, default=datetime.now) + created_date = models.DateTimeField(auto_now_add=True) + modified_date = models.DateTimeField(auto_now=True) error_reason = models.CharField(max_length=512, blank=True, default='') class Meta(object): unique_together = (('user', 'course_id'),) + app_label = "certificates" @classmethod def certificate_for_student(cls, student, course_id): @@ -315,9 +316,10 @@ class ExampleCertificateSet(TimeStampedModel): class Meta(object): get_latest_by = 'created' + app_label = "certificates" @classmethod - @transaction.commit_on_success + @transaction.atomic def create_example_set(cls, course_key): """Create a set of example certificates for a course. @@ -405,6 +407,9 @@ class ExampleCertificate(TimeStampedModel): 3) We use dummy values. """ + class Meta(object): + app_label = "certificates" + # Statuses STATUS_STARTED = 'started' STATUS_SUCCESS = 'success' @@ -572,6 +577,7 @@ class CertificateGenerationCourseSetting(TimeStampedModel): class Meta(object): get_latest_by = 'created' + app_label = "certificates" @classmethod def is_enabled_for_course(cls, course_key): @@ -618,7 +624,8 @@ class CertificateGenerationConfiguration(ConfigurationModel): certificates. """ - pass + class Meta(ConfigurationModel.Meta): + app_label = "certificates" class CertificateHtmlViewConfiguration(ConfigurationModel): @@ -637,6 +644,9 @@ class CertificateHtmlViewConfiguration(ConfigurationModel): } } """ + class Meta(ConfigurationModel.Meta): + app_label = "certificates" + configuration = models.TextField( help_text="Certificate HTML View Parameters (JSON)" ) @@ -687,6 +697,7 @@ class BadgeAssertion(models.Model): class Meta(object): unique_together = (('course_id', 'user', 'mode'),) + app_label = "certificates" def validate_badge_image(image): @@ -703,6 +714,9 @@ class BadgeImageConfiguration(models.Model): """ Contains the configuration for badges for a specific mode. The mode """ + class Meta(object): + app_label = "certificates" + mode = models.CharField( max_length=125, help_text=_(u'The course mode for this badge image. For example, "verified" or "honor".'), @@ -717,6 +731,7 @@ class BadgeImageConfiguration(models.Model): validators=[validate_badge_image] ) default = models.BooleanField( + default=False, help_text=_( u"Set this value to True if you want this image to be the default image for any course modes " u"that do not have a specified badge image. You can have only one default image." @@ -797,6 +812,7 @@ class CertificateTemplate(TimeStampedModel): class Meta(object): get_latest_by = 'created' unique_together = (('organization_id', 'course_key', 'mode'),) + app_label = "certificates" def template_assets_path(instance, filename): @@ -848,6 +864,7 @@ class CertificateTemplateAsset(TimeStampedModel): class Meta(object): get_latest_by = 'created' + app_label = "certificates" @receiver(post_save, sender=GeneratedCertificate) diff --git a/lms/djangoapps/certificates/queue.py b/lms/djangoapps/certificates/queue.py index 1279bcdd09..f8db3a4bd8 100644 --- a/lms/djangoapps/certificates/queue.py +++ b/lms/djangoapps/certificates/queue.py @@ -17,7 +17,7 @@ from capa.xqueue_interface import XQueueInterface from capa.xqueue_interface import make_xheader, make_hashkey from course_modes.models import CourseMode from student.models import UserProfile, CourseEnrollment -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from certificates.models import ( GeneratedCertificate, diff --git a/lms/djangoapps/certificates/tests/test_queue.py b/lms/djangoapps/certificates/tests/test_queue.py index 1060580a79..9dede744c5 100644 --- a/lms/djangoapps/certificates/tests/test_queue.py +++ b/lms/djangoapps/certificates/tests/test_queue.py @@ -29,7 +29,7 @@ from certificates.models import ( GeneratedCertificate, CertificateStatuses, ) -from verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory +from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory @ddt.ddt diff --git a/lms/djangoapps/certificates/views/support.py b/lms/djangoapps/certificates/views/support.py index 9cabc9baff..801775ee8a 100644 --- a/lms/djangoapps/certificates/views/support.py +++ b/lms/djangoapps/certificates/views/support.py @@ -14,6 +14,7 @@ from django.http import ( HttpResponseServerError ) from django.views.decorators.http import require_GET, require_POST +from django.db import transaction from django.db.models import Q from django.utils.translation import ugettext as _ @@ -122,6 +123,8 @@ def _validate_regen_post_params(params): return {"user": user, "course_key": course_key}, None +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @require_POST @require_certificate_permission def regenerate_certificate_for_user(request): diff --git a/lms/djangoapps/certificates/views/xqueue.py b/lms/djangoapps/certificates/views/xqueue.py index 453fe9c0b9..bd60e5221b 100644 --- a/lms/djangoapps/certificates/views/xqueue.py +++ b/lms/djangoapps/certificates/views/xqueue.py @@ -5,6 +5,7 @@ import json import logging from django.contrib.auth.models import User +from django.db import transaction from django.http import HttpResponse, Http404, HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST @@ -27,6 +28,8 @@ from certificates.models import ( log = logging.getLogger(__name__) +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @csrf_exempt def request_certificate(request): """Request the on-demand creation of a certificate for some user, course. @@ -48,8 +51,8 @@ def request_certificate(request): log_msg = u'Grading and certification requested for user %s in course %s via /request_certificate call' log.info(log_msg, username, course_key) status = generate_user_certificates(student, course_key, course=course) - return HttpResponse(json.dumps({'add_status': status}), mimetype='application/json') - return HttpResponse(json.dumps({'add_status': 'ERRORANONYMOUSUSER'}), mimetype='application/json') + return HttpResponse(json.dumps({'add_status': status}), content_type='application/json') + return HttpResponse(json.dumps({'add_status': 'ERRORANONYMOUSUSER'}), content_type='application/json') @csrf_exempt @@ -89,7 +92,7 @@ def update_certificate(request): return HttpResponse(json.dumps({ 'return_code': 1, 'content': 'unable to lookup key' - }), mimetype='application/json') + }), content_type='application/json') if 'error' in xqueue_body: cert.status = status.error @@ -123,7 +126,7 @@ def update_certificate(request): 'return_code': 1, 'content': 'invalid cert status' }), - mimetype='application/json' + content_type='application/json' ) dog_stats_api.increment(XQUEUE_METRIC_NAME, tags=[ @@ -133,7 +136,7 @@ def update_certificate(request): cert.save() return HttpResponse(json.dumps({'return_code': 0}), - mimetype='application/json') + content_type='application/json') @csrf_exempt diff --git a/lms/djangoapps/class_dashboard/views.py b/lms/djangoapps/class_dashboard/views.py index afb89c1e10..c5d6db4be5 100644 --- a/lms/djangoapps/class_dashboard/views.py +++ b/lms/djangoapps/class_dashboard/views.py @@ -49,7 +49,7 @@ def all_sequential_open_distrib(request, course_id): else: data = {'error': "Access Denied: User does not have access to this course's data"} - return HttpResponse(json.dumps(data), mimetype="application/json") + return HttpResponse(json.dumps(data), content_type="application/json") def all_problem_grade_distribution(request, course_id): @@ -75,7 +75,7 @@ def all_problem_grade_distribution(request, course_id): else: data = {'error': "Access Denied: User does not have access to this course's data"} - return HttpResponse(json.dumps(data), mimetype="application/json") + return HttpResponse(json.dumps(data), content_type="application/json") def section_problem_grade_distrib(request, course_id, section): @@ -106,4 +106,4 @@ def section_problem_grade_distrib(request, course_id, section): else: data = {'error': "Access Denied: User does not have access to this course's data"} - return HttpResponse(json.dumps(data), mimetype="application/json") + return HttpResponse(json.dumps(data), content_type="application/json") diff --git a/lms/djangoapps/commerce/api/v1/models.py b/lms/djangoapps/commerce/api/v1/models.py index be014afeed..38fdefad48 100644 --- a/lms/djangoapps/commerce/api/v1/models.py +++ b/lms/djangoapps/commerce/api/v1/models.py @@ -7,7 +7,7 @@ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from course_modes.models import CourseMode -from verify_student.models import VerificationDeadline +from lms.djangoapps.verify_student.models import VerificationDeadline log = logging.getLogger(__name__) @@ -54,7 +54,7 @@ class Course(object): return mode.mode_slug - @transaction.commit_on_success + @transaction.atomic def save(self, *args, **kwargs): # pylint: disable=unused-argument """ Save the CourseMode objects to the database. """ @@ -88,6 +88,7 @@ class Course(object): merged_mode.currency = posted_mode.currency merged_mode.sku = posted_mode.sku merged_mode.expiration_datetime = posted_mode.expiration_datetime + merged_mode.save() merged_modes.add(merged_mode) merged_mode_keys.add(merged_mode.mode_slug) diff --git a/lms/djangoapps/commerce/api/v1/tests/test_views.py b/lms/djangoapps/commerce/api/v1/tests/test_views.py index d86ddad5b2..f3db3da0cf 100644 --- a/lms/djangoapps/commerce/api/v1/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v1/tests/test_views.py @@ -22,7 +22,7 @@ from commerce.tests.mocks import mock_order_endpoint from commerce.tests.test_views import UserMixin from course_modes.models import CourseMode from student.tests.factories import UserFactory -from verify_student.models import VerificationDeadline +from lms.djangoapps.verify_student.models import VerificationDeadline PASSWORD = 'test' JSON_CONTENT_TYPE = 'application/json' diff --git a/lms/djangoapps/commerce/http.py b/lms/djangoapps/commerce/http.py index ba9e067c0a..865d69045e 100644 --- a/lms/djangoapps/commerce/http.py +++ b/lms/djangoapps/commerce/http.py @@ -10,7 +10,7 @@ class DetailResponse(JsonResponse): def __init__(self, message, status=HTTP_200_OK): data = {'detail': message} - super(DetailResponse, self).__init__(object=data, status=status) + super(DetailResponse, self).__init__(resp_obj=data, status=status) class InternalRequestErrorResponse(DetailResponse): diff --git a/lms/djangoapps/commerce/migrations/0001_add_ecommerce_service_user.py b/lms/djangoapps/commerce/migrations/0001_add_ecommerce_service_user.py deleted file mode 100644 index 2c96467493..0000000000 --- a/lms/djangoapps/commerce/migrations/0001_add_ecommerce_service_user.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf import settings -from django.contrib.auth.models import User -from django.db import models -from south.db import db -from south.utils import datetime_utils as datetime -from south.v2 import DataMigration - - -class Migration(DataMigration): - username = settings.ECOMMERCE_SERVICE_WORKER_USERNAME - email = username + '@fake.email' - - def forwards(self, orm): - """Add the service user.""" - user = User.objects.create(username=self.username, email=self.email) - user.set_unusable_password() - user.save() - - def backwards(self, orm): - """Remove the service user.""" - User.objects.get(username=self.username, email=self.email).delete() - - models = {} - complete_apps = ['commerce'] - symmetrical = True diff --git a/lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py b/lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py new file mode 100644 index 0000000000..6d6de14ecd --- /dev/null +++ b/lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from django.conf import settings +from django.contrib.auth.models import User +from django.db import models, migrations + + +USERNAME = settings.ECOMMERCE_SERVICE_WORKER_USERNAME +EMAIL = USERNAME + '@fake.email' + +def forwards(apps, schema_editor): + """Add the service user.""" + user, created = User.objects.get_or_create(username=USERNAME, email=EMAIL) + if created: + user.set_unusable_password() + user.save() + +def backwards(apps, schema_editor): + """Remove the service user.""" + User.objects.get(username=USERNAME, email=EMAIL).delete() + +class Migration(migrations.Migration): + + operations = [ + migrations.RunPython(forwards, backwards), + ] diff --git a/lms/djangoapps/commerce/views.py b/lms/djangoapps/commerce/views.py index 92094e5986..75750d598f 100644 --- a/lms/djangoapps/commerce/views.py +++ b/lms/djangoapps/commerce/views.py @@ -7,7 +7,7 @@ from django.views.decorators.csrf import csrf_exempt from edxmako.shortcuts import render_to_response from microsite_configuration import microsite -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from shoppingcart.processors.CyberSource2 import is_user_payment_error from django.utils.translation import ugettext as _ diff --git a/lms/djangoapps/course_api/blocks/views.py b/lms/djangoapps/course_api/blocks/views.py index ed44d1f496..1fb4376408 100644 --- a/lms/djangoapps/course_api/blocks/views.py +++ b/lms/djangoapps/course_api/blocks/views.py @@ -161,7 +161,7 @@ class BlocksView(DeveloperErrorViewMixin, ListAPIView): """ # validate request parameters - requested_params = request.QUERY_PARAMS.copy() + requested_params = request.query_params.copy() requested_params.update({'usage_key': usage_key_string}) params = BlockListGetForm(requested_params, initial={'requesting_user': request.user}) if not params.is_valid(): @@ -236,7 +236,7 @@ class BlocksInCourseView(BlocksView): """ # convert the requested course_key to the course's root block's usage_key - course_key_string = request.QUERY_PARAMS.get('course_id', None) + course_key_string = request.query_params.get('course_id', None) if not course_key_string: raise ValidationError('course_id is required.') diff --git a/lms/djangoapps/course_wiki/editors.py b/lms/djangoapps/course_wiki/editors.py index ad6631c500..eb20915b47 100644 --- a/lms/djangoapps/course_wiki/editors.py +++ b/lms/djangoapps/course_wiki/editors.py @@ -1,5 +1,5 @@ from django import forms -from django.forms.util import flatatt +from django.forms.utils import flatatt from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe diff --git a/lms/djangoapps/courseware/date_summary.py b/lms/djangoapps/courseware/date_summary.py index c1af8c460c..20a9a2fca7 100644 --- a/lms/djangoapps/courseware/date_summary.py +++ b/lms/djangoapps/courseware/date_summary.py @@ -14,7 +14,7 @@ from lazy import lazy import pytz from course_modes.models import CourseMode -from verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification from student.models import CourseEnrollment diff --git a/lms/djangoapps/courseware/grades.py b/lms/djangoapps/courseware/grades.py index 008e0644e4..06a5fff5c9 100644 --- a/lms/djangoapps/courseware/grades.py +++ b/lms/djangoapps/courseware/grades.py @@ -8,7 +8,6 @@ import logging from contextlib import contextmanager from django.conf import settings -from django.db import transaction from django.test.client import RequestFactory from django.core.cache import cache @@ -18,6 +17,7 @@ from courseware import courses from courseware.access import has_access from courseware.model_data import FieldDataCache, ScoresClient from student.models import anonymous_id_for_user +from util.db import outer_atomic from util.module_utils import yield_dynamic_descriptor_descendants from xmodule import graders from xmodule.graders import Score @@ -295,27 +295,25 @@ def answer_distributions(course_key): return answer_counts -@transaction.commit_manually def grade(student, request, course, keep_raw_scores=False, field_data_cache=None, scores_client=None): """ - Wraps "_grade" with the manual_transaction context manager just in case - there are unanticipated errors. - Send a signal to update the minimum grade requirement status. + Returns the grade of the student. + + Also sends a signal to update the minimum grade requirement status. """ - with manual_transaction(): - grade_summary = _grade(student, request, course, keep_raw_scores, field_data_cache, scores_client) - responses = GRADES_UPDATED.send_robust( - sender=None, - username=student.username, - grade_summary=grade_summary, - course_key=course.id, - deadline=course.end - ) + grade_summary = _grade(student, request, course, keep_raw_scores, field_data_cache, scores_client) + responses = GRADES_UPDATED.send_robust( + sender=None, + username=student.username, + grade_summary=grade_summary, + course_key=course.id, + deadline=course.end + ) - for receiver, response in responses: - log.info('Signal fired when student grade is calculated. Receiver: %s. Response: %s', receiver, response) + for receiver, response in responses: + log.info('Signal fired when student grade is calculated. Receiver: %s. Response: %s', receiver, response) - return grade_summary + return grade_summary def _grade(student, request, course, keep_raw_scores, field_data_cache, scores_client): @@ -339,11 +337,11 @@ def _grade(student, request, course, keep_raw_scores, field_data_cache, scores_c More information on the format is in the docstring for CourseGrader. """ - if field_data_cache is None: - with manual_transaction(): + with outer_atomic(): + if field_data_cache is None: field_data_cache = field_data_cache_for_grading(course, student) - if scores_client is None: - scores_client = ScoresClient.from_field_data_cache(field_data_cache) + if scores_client is None: + scores_client = ScoresClient.from_field_data_cache(field_data_cache) # Dict of item_ids -> (earned, possible) point tuples. This *only* grabs # scores that were registered with the submissions API, which for the moment @@ -352,14 +350,19 @@ def _grade(student, request, course, keep_raw_scores, field_data_cache, scores_c # XBlock --> submissions --> Django Rest Framework error strings --> # Django translation --> ... --> courseware --> submissions from submissions import api as sub_api # installed from the edx-submissions repository - submissions_scores = sub_api.get_scores(course.id.to_deprecated_string(), anonymous_id_for_user(student, course.id)) - max_scores_cache = MaxScoresCache.create_for_course(course) - # For the moment, we have to get scorable_locations from field_data_cache - # and not from scores_client, because scores_client is ignorant of things - # in the submissions API. As a further refactoring step, submissions should - # be hidden behind the ScoresClient. - max_scores_cache.fetch_from_remote(field_data_cache.scorable_locations) + with outer_atomic(): + submissions_scores = sub_api.get_scores( + course.id.to_deprecated_string(), + anonymous_id_for_user(student, course.id) + ) + max_scores_cache = MaxScoresCache.create_for_course(course) + + # For the moment, we have to get scorable_locations from field_data_cache + # and not from scores_client, because scores_client is ignorant of things + # in the submissions API. As a further refactoring step, submissions should + # be hidden behind the ScoresClient. + max_scores_cache.fetch_from_remote(field_data_cache.scorable_locations) grading_context = course.grading_context raw_scores = [] @@ -373,113 +376,120 @@ def _grade(student, request, course, keep_raw_scores, field_data_cache, scores_c section_descriptor = section['section_descriptor'] section_name = section_descriptor.display_name_with_default - # some problems have state that is updated independently of interaction - # with the LMS, so they need to always be scored. (E.g. foldit., - # combinedopenended) - should_grade_section = any( - descriptor.always_recalculate_grades for descriptor in section['xmoduledescriptors'] - ) - - # If there are no problems that always have to be regraded, check to - # see if any of our locations are in the scores from the submissions - # API. If scores exist, we have to calculate grades for this section. - if not should_grade_section: + with outer_atomic(): + # some problems have state that is updated independently of interaction + # with the LMS, so they need to always be scored. (E.g. foldit., + # combinedopenended) + # TODO This block is causing extra savepoints to be fired that are empty because no queries are executed + # during the loop. When refactoring this code please keep this outer_atomic call in mind and ensure we + # are not making unnecessary database queries. should_grade_section = any( - descriptor.location.to_deprecated_string() in submissions_scores - for descriptor in section['xmoduledescriptors'] + descriptor.always_recalculate_grades for descriptor in section['xmoduledescriptors'] ) - if not should_grade_section: - should_grade_section = any( - descriptor.location in scores_client - for descriptor in section['xmoduledescriptors'] - ) - - # If we haven't seen a single problem in the section, we don't have - # to grade it at all! We can assume 0% - if should_grade_section: - scores = [] - - def create_module(descriptor): - '''creates an XModule instance given a descriptor''' - # TODO: We need the request to pass into here. If we could forego that, our arguments - # would be simpler - return get_module_for_descriptor( - student, request, descriptor, field_data_cache, course.id, course=course + # If there are no problems that always have to be regraded, check to + # see if any of our locations are in the scores from the submissions + # API. If scores exist, we have to calculate grades for this section. + if not should_grade_section: + should_grade_section = any( + descriptor.location.to_deprecated_string() in submissions_scores + for descriptor in section['xmoduledescriptors'] ) - descendants = yield_dynamic_descriptor_descendants(section_descriptor, student.id, create_module) - for module_descriptor in descendants: - user_access = has_access(student, 'load', module_descriptor, module_descriptor.location.course_key) - if not user_access: - continue - - (correct, total) = get_score( - student, - module_descriptor, - create_module, - scores_client, - submissions_scores, - max_scores_cache, + if not should_grade_section: + should_grade_section = any( + descriptor.location in scores_client + for descriptor in section['xmoduledescriptors'] ) - if correct is None and total is None: - continue - if settings.GENERATE_PROFILE_SCORES: # for debugging! - if total > 1: - correct = random.randrange(max(total - 2, 1), total + 1) - else: - correct = total + # If we haven't seen a single problem in the section, we don't have + # to grade it at all! We can assume 0% + if should_grade_section: + scores = [] - graded = module_descriptor.graded - if not total > 0: - # We simply cannot grade a problem that is 12/0, because we might need it as a percentage - graded = False - - scores.append( - Score( - correct, - total, - graded, - module_descriptor.display_name_with_default, - module_descriptor.location + def create_module(descriptor): + '''creates an XModule instance given a descriptor''' + # TODO: We need the request to pass into here. If we could forego that, our arguments + # would be simpler + return get_module_for_descriptor( + student, request, descriptor, field_data_cache, course.id, course=course ) + + descendants = yield_dynamic_descriptor_descendants(section_descriptor, student.id, create_module) + for module_descriptor in descendants: + user_access = has_access( + student, 'load', module_descriptor, module_descriptor.location.course_key + ) + if not user_access: + continue + + (correct, total) = get_score( + student, + module_descriptor, + create_module, + scores_client, + submissions_scores, + max_scores_cache, + ) + if correct is None and total is None: + continue + + if settings.GENERATE_PROFILE_SCORES: # for debugging! + if total > 1: + correct = random.randrange(max(total - 2, 1), total + 1) + else: + correct = total + + graded = module_descriptor.graded + if not total > 0: + # We simply cannot grade a problem that is 12/0, because we might need it as a percentage + graded = False + + scores.append( + Score( + correct, + total, + graded, + module_descriptor.display_name_with_default, + module_descriptor.location + ) + ) + + __, graded_total = graders.aggregate_scores(scores, section_name) + if keep_raw_scores: + raw_scores += scores + else: + graded_total = Score(0.0, 1.0, True, section_name, None) + + #Add the graded total to totaled_scores + if graded_total.possible > 0: + format_scores.append(graded_total) + else: + log.info( + "Unable to grade a section with a total possible score of zero. " + + str(section_descriptor.location) ) - __, graded_total = graders.aggregate_scores(scores, section_name) - if keep_raw_scores: - raw_scores += scores - else: - graded_total = Score(0.0, 1.0, True, section_name, None) - - #Add the graded total to totaled_scores - if graded_total.possible > 0: - format_scores.append(graded_total) - else: - log.info( - "Unable to grade a section with a total possible score of zero. " + - str(section_descriptor.location) - ) - totaled_scores[section_format] = format_scores - # Grading policy might be overriden by a CCX, need to reset it - course.set_grading_policy(course.grading_policy) - grade_summary = course.grader.grade(totaled_scores, generate_random_scores=settings.GENERATE_PROFILE_SCORES) + with outer_atomic(): + # Grading policy might be overriden by a CCX, need to reset it + course.set_grading_policy(course.grading_policy) + grade_summary = course.grader.grade(totaled_scores, generate_random_scores=settings.GENERATE_PROFILE_SCORES) - # We round the grade here, to make sure that the grade is an whole percentage and - # doesn't get displayed differently than it gets grades - grade_summary['percent'] = round(grade_summary['percent'] * 100 + 0.05) / 100 + # We round the grade here, to make sure that the grade is an whole percentage and + # doesn't get displayed differently than it gets grades + grade_summary['percent'] = round(grade_summary['percent'] * 100 + 0.05) / 100 - letter_grade = grade_for_percentage(course.grade_cutoffs, grade_summary['percent']) - grade_summary['grade'] = letter_grade - grade_summary['totaled_scores'] = totaled_scores # make this available, eg for instructor download & debugging - if keep_raw_scores: - # way to get all RAW scores out to instructor - # so grader can be double-checked - grade_summary['raw_scores'] = raw_scores + letter_grade = grade_for_percentage(course.grade_cutoffs, grade_summary['percent']) + grade_summary['grade'] = letter_grade + grade_summary['totaled_scores'] = totaled_scores # make this available, eg for instructor download & debugging + if keep_raw_scores: + # way to get all RAW scores out to instructor + # so grader can be double-checked + grade_summary['raw_scores'] = raw_scores - max_scores_cache.push_to_remote() + max_scores_cache.push_to_remote() return grade_summary @@ -506,29 +516,24 @@ def grade_for_percentage(grade_cutoffs, percentage): return letter_grade -@transaction.commit_manually def progress_summary(student, request, course, field_data_cache=None, scores_client=None): """ - Wraps "_progress_summary" with the manual_transaction context manager just - in case there are unanticipated errors. + Returns progress summary for all chapters in the course. """ - with manual_transaction(): - progress = _progress_summary(student, request, course, field_data_cache, scores_client) - if progress: - return progress.chapters - else: - return None + progress = _progress_summary(student, request, course, field_data_cache, scores_client) + if progress: + return progress.chapters + else: + return None -@transaction.commit_manually def get_weighted_scores(student, course, field_data_cache=None, scores_client=None): """ Uses the _progress_summary method to return a ProgressSummmary object containing details of a students weighted scores for the course. """ - with manual_transaction(): - request = _get_mock_request(student) - return _progress_summary(student, request, course, field_data_cache, scores_client) + request = _get_mock_request(student) + return _progress_summary(student, request, course, field_data_cache, scores_client) # TODO: This method is not very good. It was written in the old course style and @@ -555,7 +560,7 @@ def _progress_summary(student, request, course, field_data_cache=None, scores_cl will return None. """ - with manual_transaction(): + with outer_atomic(): if field_data_cache is None: field_data_cache = field_data_cache_for_grading(course, student) if scores_client is None: @@ -573,14 +578,17 @@ def _progress_summary(student, request, course, field_data_cache=None, scores_cl # XBlock --> submissions --> Django Rest Framework error strings --> # Django translation --> ... --> courseware --> submissions from submissions import api as sub_api # installed from the edx-submissions repository - submissions_scores = sub_api.get_scores(course.id.to_deprecated_string(), anonymous_id_for_user(student, course.id)) + with outer_atomic(): + submissions_scores = sub_api.get_scores( + course.id.to_deprecated_string(), anonymous_id_for_user(student, course.id) + ) - max_scores_cache = MaxScoresCache.create_for_course(course) - # For the moment, we have to get scorable_locations from field_data_cache - # and not from scores_client, because scores_client is ignorant of things - # in the submissions API. As a further refactoring step, submissions should - # be hidden behind the ScoresClient. - max_scores_cache.fetch_from_remote(field_data_cache.scorable_locations) + max_scores_cache = MaxScoresCache.create_for_course(course) + # For the moment, we have to get scorable_locations from field_data_cache + # and not from scores_client, because scores_client is ignorant of things + # in the submissions API. As a further refactoring step, submissions should + # be hidden behind the ScoresClient. + max_scores_cache.fetch_from_remote(field_data_cache.scorable_locations) chapters = [] locations_to_children = defaultdict(list) @@ -594,7 +602,7 @@ def _progress_summary(student, request, course, field_data_cache=None, scores_cl sections = [] for section_module in chapter_module.get_display_items(): # Skip if the section is hidden - with manual_transaction(): + with outer_atomic(): if section_module.hide_from_toc: continue @@ -745,19 +753,6 @@ def get_score(user, problem_descriptor, module_creator, scores_client, submissio return weighted_score(correct, total, problem_descriptor.weight) -@contextmanager -def manual_transaction(): - """A context manager for managing manual transactions""" - try: - yield - except Exception: - transaction.rollback() - log.exception('Due to an error, this transaction has been rolled back') - raise - else: - transaction.commit() - - def iterate_grades_for(course_or_id, students, keep_raw_scores=False): """Given a course_id and an iterable of students (User), yield a tuple of: diff --git a/lms/djangoapps/courseware/management/commands/clean_history.py b/lms/djangoapps/courseware/management/commands/clean_history.py index 788ac6e399..d4f22a0e3e 100644 --- a/lms/djangoapps/courseware/management/commands/clean_history.py +++ b/lms/djangoapps/courseware/management/commands/clean_history.py @@ -74,20 +74,21 @@ class StudentModuleHistoryCleaner(object): batch_size = batch_size or self.BATCH_SIZE - transaction.enter_transaction_management() - self.last_student_module_id = self.get_last_student_module_id() self.load_state() while self.next_student_module_id <= self.last_student_module_id: - for smid in self.module_ids_to_check(batch_size): - try: - self.clean_one_student_module(smid) - except Exception: # pylint: disable=broad-except - trace = traceback.format_exc() - self.say("Couldn't clean student_module_id {}:\n{}".format(smid, trace)) - if not self.dry_run: - self.commit() + with transaction.atomic(): + for smid in self.module_ids_to_check(batch_size): + try: + self.clean_one_student_module(smid) + except Exception: # pylint: disable=broad-except + trace = traceback.format_exc() + self.say("Couldn't clean student_module_id {}:\n{}".format(smid, trace)) + if self.dry_run: + transaction.set_rollback(True) + else: + self.say("Committing") self.save_state() if sleep: time.sleep(sleep) @@ -101,13 +102,6 @@ class StudentModuleHistoryCleaner(object): """ print message - def commit(self): - """ - Commit the transaction. - """ - self.say("Committing") - transaction.commit() - def load_state(self): """ Load the latest state from disk. diff --git a/lms/djangoapps/courseware/management/commands/dump_course_ids.py b/lms/djangoapps/courseware/management/commands/dump_course_ids.py index 715fe7cc30..95577023df 100644 --- a/lms/djangoapps/courseware/management/commands/dump_course_ids.py +++ b/lms/djangoapps/courseware/management/commands/dump_course_ids.py @@ -35,7 +35,6 @@ class Command(BaseCommand): if store is None: raise CommandError("Unknown modulestore {}".format(name)) + output = u'\n'.join(unicode(course.id) for course in store.get_courses()) + '\n' - output = u'\n'.join(course.id.to_deprecated_string() for course in store.get_courses()) + '\n' - - return output.encode('utf-8') + return output diff --git a/lms/djangoapps/courseware/management/commands/export_course.py b/lms/djangoapps/courseware/management/commands/export_course.py index 3f09950f8c..1b6bb0b594 100644 --- a/lms/djangoapps/courseware/management/commands/export_course.py +++ b/lms/djangoapps/courseware/management/commands/export_course.py @@ -37,7 +37,7 @@ class Command(BaseCommand): results = self._get_results(filename) if pipe_results else None - return results + self.stdout.write(results, ending="") def _parse_arguments(self, args): """Parse command line arguments""" diff --git a/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py b/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py index 01026751c0..e0c7da7af9 100644 --- a/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py +++ b/lms/djangoapps/courseware/management/commands/tests/test_clean_history.py @@ -393,9 +393,6 @@ class SmhcForTestingMain(SmhcSayStubbed): if smid in self.exception_smids: raise Exception("Something went wrong!") - def commit(self): - self.say("(not really committing)") - @attr('shard_1') class HistoryCleanerMainTest(HistoryCleanerTest): @@ -413,7 +410,7 @@ class HistoryCleanerMainTest(HistoryCleanerTest): 'No stored state', '(not really cleaning 0)', '(not really cleaning 1)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 2}', ) @@ -434,7 +431,7 @@ class HistoryCleanerMainTest(HistoryCleanerTest): 'Loaded stored state: {"next_student_module_id": 25}', '(not really cleaning 25)', '(not really cleaning 26)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 27}' ) @@ -457,11 +454,11 @@ class HistoryCleanerMainTest(HistoryCleanerTest): '(not really cleaning 25)', '(not really cleaning 26)', '(not really cleaning 27)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 28}', '(not really cleaning 28)', '(not really cleaning 29)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 30}', ) @@ -485,10 +482,10 @@ class HistoryCleanerMainTest(HistoryCleanerTest): '(not really cleaning 26)', "Couldn't clean student_module_id 26:\nTraceback*Exception: Something went wrong!\n", '(not really cleaning 27)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 28}', '(not really cleaning 28)', '(not really cleaning 29)', - '(not really committing)', + 'Committing', 'Saved state: {"next_student_module_id": 30}', ) diff --git a/lms/djangoapps/courseware/migrations/0001_initial.py b/lms/djangoapps/courseware/migrations/0001_initial.py index 4c29ca17a5..a852b54e02 100644 --- a/lms/djangoapps/courseware/migrations/0001_initial.py +++ b/lms/djangoapps/courseware/migrations/0001_initial.py @@ -1,111 +1,148 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import openedx.core.djangoapps.call_stack_manager.core +import model_utils.fields +import xmodule_django.models +import django.utils.timezone +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'StudentModule' - db.create_table('courseware_studentmodule', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('module_type', self.gf('django.db.models.fields.CharField')(default='problem', max_length=32)), - ('module_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('student', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('state', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('grade', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('courseware', ['StudentModule']) - - # Adding unique constraint on 'StudentModule', fields ['student', 'module_id', 'module_type'] - db.create_unique('courseware_studentmodule', ['student_id', 'module_id', 'module_type']) - - def backwards(self, orm): - - # Removing unique constraint on 'StudentModule', fields ['student', 'module_id', 'module_type'] - db.delete_unique('courseware_studentmodule', ['student_id', 'module_id', 'module_type']) - - # Deleting model 'StudentModule' - db.delete_table('courseware_studentmodule') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_id', 'module_type'),)", 'object_name': 'StudentModule'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'module_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['courseware'] + operations = [ + migrations.CreateModel( + name='OfflineComputedGrade', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ('updated', models.DateTimeField(auto_now=True, db_index=True)), + ('gradeset', models.TextField(null=True, blank=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='OfflineComputedGradeLog', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ('seconds', models.IntegerField(default=0)), + ('nstudents', models.IntegerField(default=0)), + ], + options={ + 'ordering': ['-created'], + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='StudentFieldOverride', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('location', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), + ('field', models.CharField(max_length=255)), + ('value', models.TextField(default=b'null')), + ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='StudentModule', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('module_type', models.CharField(default=b'problem', max_length=32, db_index=True, choices=[(b'problem', b'problem'), (b'video', b'video'), (b'html', b'html'), (b'course', b'course'), (b'chapter', b'Section'), (b'sequential', b'Subsection'), (b'library_content', b'Library Content')])), + ('module_state_key', xmodule_django.models.LocationKeyField(max_length=255, db_column=b'module_id', db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('state', models.TextField(null=True, blank=True)), + ('grade', models.FloatField(db_index=True, null=True, blank=True)), + ('max_grade', models.FloatField(null=True, blank=True)), + ('done', models.CharField(default=b'na', max_length=8, db_index=True, choices=[(b'na', b'NOT_APPLICABLE'), (b'f', b'FINISHED'), (b'i', b'INCOMPLETE')])), + ('created', models.DateTimeField(auto_now_add=True, db_index=True)), + ('modified', models.DateTimeField(auto_now=True, db_index=True)), + ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + bases=(openedx.core.djangoapps.call_stack_manager.core.CallStackMixin, models.Model), + ), + migrations.CreateModel( + name='StudentModuleHistory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('version', models.CharField(db_index=True, max_length=255, null=True, blank=True)), + ('created', models.DateTimeField(db_index=True)), + ('state', models.TextField(null=True, blank=True)), + ('grade', models.FloatField(null=True, blank=True)), + ('max_grade', models.FloatField(null=True, blank=True)), + ('student_module', models.ForeignKey(to='courseware.StudentModule')), + ], + options={ + 'get_latest_by': 'created', + }, + bases=(openedx.core.djangoapps.call_stack_manager.core.CallStackMixin, models.Model), + ), + migrations.CreateModel( + name='XModuleStudentInfoField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('field_name', models.CharField(max_length=64, db_index=True)), + ('value', models.TextField(default=b'null')), + ('created', models.DateTimeField(auto_now_add=True, db_index=True)), + ('modified', models.DateTimeField(auto_now=True, db_index=True)), + ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='XModuleStudentPrefsField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('field_name', models.CharField(max_length=64, db_index=True)), + ('value', models.TextField(default=b'null')), + ('created', models.DateTimeField(auto_now_add=True, db_index=True)), + ('modified', models.DateTimeField(auto_now=True, db_index=True)), + ('module_type', xmodule_django.models.BlockTypeKeyField(max_length=64, db_index=True)), + ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='XModuleUserStateSummaryField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('field_name', models.CharField(max_length=64, db_index=True)), + ('value', models.TextField(default=b'null')), + ('created', models.DateTimeField(auto_now_add=True, db_index=True)), + ('modified', models.DateTimeField(auto_now=True, db_index=True)), + ('usage_id', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), + ], + ), + migrations.AlterUniqueTogether( + name='xmoduleuserstatesummaryfield', + unique_together=set([('usage_id', 'field_name')]), + ), + migrations.AlterUniqueTogether( + name='xmodulestudentprefsfield', + unique_together=set([('student', 'module_type', 'field_name')]), + ), + migrations.AlterUniqueTogether( + name='xmodulestudentinfofield', + unique_together=set([('student', 'field_name')]), + ), + migrations.AlterUniqueTogether( + name='studentmodule', + unique_together=set([('student', 'module_state_key', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='studentfieldoverride', + unique_together=set([('course_id', 'field', 'location', 'student')]), + ), + migrations.AlterUniqueTogether( + name='offlinecomputedgrade', + unique_together=set([('user', 'course_id')]), + ), + ] diff --git a/lms/djangoapps/courseware/migrations/0002_add_indexes.py b/lms/djangoapps/courseware/migrations/0002_add_indexes.py deleted file mode 100644 index 7de33b4c52..0000000000 --- a/lms/djangoapps/courseware/migrations/0002_add_indexes.py +++ /dev/null @@ -1,119 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding index on 'StudentModule', fields ['created'] - db.create_index('courseware_studentmodule', ['created']) - - # Adding index on 'StudentModule', fields ['grade'] - db.create_index('courseware_studentmodule', ['grade']) - - # Adding index on 'StudentModule', fields ['modified'] - db.create_index('courseware_studentmodule', ['modified']) - - # Adding index on 'StudentModule', fields ['module_type'] - db.create_index('courseware_studentmodule', ['module_type']) - - # Adding index on 'StudentModule', fields ['module_id'] - db.create_index('courseware_studentmodule', ['module_id']) - - def backwards(self, orm): - - # Removing index on 'StudentModule', fields ['module_id'] - db.delete_index('courseware_studentmodule', ['module_id']) - - # Removing index on 'StudentModule', fields ['module_type'] - db.delete_index('courseware_studentmodule', ['module_type']) - - # Removing index on 'StudentModule', fields ['modified'] - db.delete_index('courseware_studentmodule', ['modified']) - - # Removing index on 'StudentModule', fields ['grade'] - db.delete_index('courseware_studentmodule', ['grade']) - - # Removing index on 'StudentModule', fields ['created'] - db.delete_index('courseware_studentmodule', ['created']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_id', 'module_type'),)", 'object_name': 'StudentModule'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0003_done_grade_cache.py b/lms/djangoapps/courseware/migrations/0003_done_grade_cache.py deleted file mode 100644 index 0ab35551c9..0000000000 --- a/lms/djangoapps/courseware/migrations/0003_done_grade_cache.py +++ /dev/null @@ -1,117 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # NOTE (vshnayder): This constraint has the wrong field order, so it doesn't actually - # do anything in sqlite. Migration 0004 actually removes this index for sqlite. - # Removing unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student'] - db.delete_unique('courseware_studentmodule', ['module_id', 'module_type', 'student_id']) - - # Adding field 'StudentModule.max_grade' - db.add_column('courseware_studentmodule', 'max_grade', self.gf('django.db.models.fields.FloatField')(null=True, blank=True), keep_default=False) - - # Adding field 'StudentModule.done' - db.add_column('courseware_studentmodule', 'done', self.gf('django.db.models.fields.CharField')(default='na', max_length=8, db_index=True), keep_default=False) - - # Adding unique constraint on 'StudentModule', fields ['module_id', 'student'] - db.create_unique('courseware_studentmodule', ['module_id', 'student_id']) - - def backwards(self, orm): - - # Removing unique constraint on 'StudentModule', fields ['module_id', 'student'] - db.delete_unique('courseware_studentmodule', ['module_id', 'student_id']) - - # Deleting field 'StudentModule.max_grade' - db.delete_column('courseware_studentmodule', 'max_grade') - - # Deleting field 'StudentModule.done' - db.delete_column('courseware_studentmodule', 'done') - - # Adding unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student'] - db.create_unique('courseware_studentmodule', ['module_id', 'module_type', 'student_id']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_id'),)", 'object_name': 'StudentModule'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py b/lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py deleted file mode 100644 index ff79901824..0000000000 --- a/lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py +++ /dev/null @@ -1,120 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'StudentModule.course_id' - db.add_column('courseware_studentmodule', 'course_id', - self.gf('django.db.models.fields.CharField')(default="", max_length=255, db_index=True), - keep_default=False) - - # Removing unique constraint on 'StudentModule', fields ['module_id', 'student'] - db.delete_unique('courseware_studentmodule', ['module_id', 'student_id']) - - # NOTE: manually remove this constaint (from 0001)--0003 tries, but fails for sqlite. - # Removing unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student'] - if db.backend_name == "sqlite3": - db.delete_unique('courseware_studentmodule', ['student_id', 'module_id', 'module_type']) - - # Adding unique constraint on 'StudentModule', fields ['course_id', 'module_state_key', 'student'] - db.create_unique('courseware_studentmodule', ['student_id', 'module_id', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'StudentModule', fields ['studnet_id', 'module_state_key', 'course_id'] - db.delete_unique('courseware_studentmodule', ['student_id', 'module_id', 'course_id']) - - # Deleting field 'StudentModule.course_id' - db.delete_column('courseware_studentmodule', 'course_id') - - # Adding unique constraint on 'StudentModule', fields ['module_id', 'student'] - db.create_unique('courseware_studentmodule', ['module_id', 'student_id']) - - # Adding unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student'] - db.create_unique('courseware_studentmodule', ['student_id', 'module_id', 'module_type']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('course_id', 'student', 'module_state_key'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c.py b/lms/djangoapps/courseware/migrations/0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c.py deleted file mode 100644 index 4c21d22937..0000000000 --- a/lms/djangoapps/courseware/migrations/0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c.py +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'OfflineComputedGrade' - db.create_table('courseware_offlinecomputedgrade', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, db_index=True, blank=True)), - ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - ('gradeset', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('courseware', ['OfflineComputedGrade']) - - # Adding unique constraint on 'OfflineComputedGrade', fields ['user', 'course_id'] - db.create_unique('courseware_offlinecomputedgrade', ['user_id', 'course_id']) - - # Adding model 'OfflineComputedGradeLog' - db.create_table('courseware_offlinecomputedgradelog', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, db_index=True, blank=True)), - ('seconds', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('nstudents', self.gf('django.db.models.fields.IntegerField')(default=0)), - )) - db.send_create_signal('courseware', ['OfflineComputedGradeLog']) - - - def backwards(self, orm): - # Removing unique constraint on 'OfflineComputedGrade', fields ['user', 'course_id'] - db.delete_unique('courseware_offlinecomputedgrade', ['user_id', 'course_id']) - - # Deleting model 'OfflineComputedGrade' - db.delete_table('courseware_offlinecomputedgrade') - - # Deleting model 'OfflineComputedGradeLog' - db.delete_table('courseware_offlinecomputedgradelog') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py b/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py deleted file mode 100644 index c1243510b7..0000000000 --- a/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'StudentModuleHistory' - db.create_table('courseware_studentmodulehistory', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('student_module', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['courseware.StudentModule'])), - ('version', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), - ('state', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('grade', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), - ('max_grade', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), - )) - db.send_create_signal('courseware', ['StudentModuleHistory']) - - - def backwards(self, orm): - # Deleting model 'StudentModuleHistory' - db.delete_table('courseware_studentmodulehistory') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py b/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py deleted file mode 100644 index 4b459c1655..0000000000 --- a/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'StudentModuleHistory.version' - db.alter_column('courseware_studentmodulehistory', 'version', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)) - - def backwards(self, orm): - - # User chose to not deal with backwards NULL issues for 'StudentModuleHistory.version' - raise RuntimeError("Cannot reverse this migration. 'StudentModuleHistory.version' and its values cannot be restored.") - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'db_index': 'True'}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py b/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py deleted file mode 100644 index edbbc42753..0000000000 --- a/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py +++ /dev/null @@ -1,185 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'XModuleStudentInfoField' - db.create_table('courseware_xmodulestudentinfofield', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('student', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - )) - db.send_create_signal('courseware', ['XModuleStudentInfoField']) - - # Adding unique constraint on 'XModuleStudentInfoField', fields ['student', 'field_name'] - db.create_unique('courseware_xmodulestudentinfofield', ['student_id', 'field_name']) - - # Adding model 'XModuleContentField' - db.create_table('courseware_xmodulecontentfield', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('definition_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - )) - db.send_create_signal('courseware', ['XModuleContentField']) - - # Adding unique constraint on 'XModuleContentField', fields ['definition_id', 'field_name'] - db.create_unique('courseware_xmodulecontentfield', ['definition_id', 'field_name']) - - # Adding model 'XModuleSettingsField' - db.create_table('courseware_xmodulesettingsfield', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('usage_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - )) - db.send_create_signal('courseware', ['XModuleSettingsField']) - - # Adding unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] - db.create_unique('courseware_xmodulesettingsfield', ['usage_id', 'field_name']) - - # Adding model 'XModuleStudentPrefsField' - db.create_table('courseware_xmodulestudentprefsfield', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('module_type', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('student', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - )) - db.send_create_signal('courseware', ['XModuleStudentPrefsField']) - - # Adding unique constraint on 'XModuleStudentPrefsField', fields ['student', 'module_type', 'field_name'] - db.create_unique('courseware_xmodulestudentprefsfield', ['student_id', 'module_type', 'field_name']) - - - def backwards(self, orm): - # Removing unique constraint on 'XModuleStudentPrefsField', fields ['student', 'module_type', 'field_name'] - db.delete_unique('courseware_xmodulestudentprefsfield', ['student_id', 'module_type', 'field_name']) - - # Removing unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] - db.delete_unique('courseware_xmodulesettingsfield', ['usage_id', 'field_name']) - - # Removing unique constraint on 'XModuleContentField', fields ['definition_id', 'field_name'] - db.delete_unique('courseware_xmodulecontentfield', ['definition_id', 'field_name']) - - # Removing unique constraint on 'XModuleStudentInfoField', fields ['student', 'field_name'] - db.delete_unique('courseware_xmodulestudentinfofield', ['student_id', 'field_name']) - - # Deleting model 'XModuleStudentInfoField' - db.delete_table('courseware_xmodulestudentinfofield') - - # Deleting model 'XModuleContentField' - db.delete_table('courseware_xmodulecontentfield') - - # Deleting model 'XModuleSettingsField' - db.delete_table('courseware_xmodulesettingsfield') - - # Deleting model 'XModuleStudentPrefsField' - db.delete_table('courseware_xmodulestudentprefsfield') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.xmodulecontentfield': { - 'Meta': {'unique_together': "(('definition_id', 'field_name'),)", 'object_name': 'XModuleContentField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'definition_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulesettingsfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleSettingsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0009_add_field_default.py b/lms/djangoapps/courseware/migrations/0009_add_field_default.py deleted file mode 100644 index 50be9f343b..0000000000 --- a/lms/djangoapps/courseware/migrations/0009_add_field_default.py +++ /dev/null @@ -1,128 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'XModuleContentField.value' - db.alter_column('courseware_xmodulecontentfield', 'value', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'XModuleStudentInfoField.value' - db.alter_column('courseware_xmodulestudentinfofield', 'value', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'XModuleSettingsField.value' - db.alter_column('courseware_xmodulesettingsfield', 'value', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'XModuleStudentPrefsField.value' - db.alter_column('courseware_xmodulestudentprefsfield', 'value', self.gf('django.db.models.fields.TextField')()) - - def backwards(self, orm): - - # Changing field 'XModuleContentField.value' - db.alter_column('courseware_xmodulecontentfield', 'value', self.gf('django.db.models.fields.TextField')(null=True)) - - # Changing field 'XModuleStudentInfoField.value' - db.alter_column('courseware_xmodulestudentinfofield', 'value', self.gf('django.db.models.fields.TextField')(null=True)) - - # Changing field 'XModuleSettingsField.value' - db.alter_column('courseware_xmodulesettingsfield', 'value', self.gf('django.db.models.fields.TextField')(null=True)) - - # Changing field 'XModuleStudentPrefsField.value' - db.alter_column('courseware_xmodulestudentprefsfield', 'value', self.gf('django.db.models.fields.TextField')(null=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.xmodulecontentfield': { - 'Meta': {'unique_together': "(('definition_id', 'field_name'),)", 'object_name': 'XModuleContentField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'definition_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulesettingsfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleSettingsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py b/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py deleted file mode 100644 index d2025c36ec..0000000000 --- a/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] - db.delete_unique('courseware_xmodulesettingsfield', ['usage_id', 'field_name']) - - # Deleting model 'XModuleSettingsField' - db.delete_table('courseware_xmodulesettingsfield') - - # Move all content currently stored as Scope.content to Scope.user_state_summary - db.rename_table('courseware_xmodulecontentfield', 'courseware_xmoduleuserstatesummaryfield') - db.rename_column('courseware_xmoduleuserstatesummaryfield', 'definition_id', 'usage_id') - - - def backwards(self, orm): - # Adding model 'XModuleSettingsField' - db.create_table('courseware_xmodulesettingsfield', ( - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True, db_index=True)), - ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')(default='null')), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('usage_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('courseware', ['XModuleSettingsField']) - - # Adding unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] - db.create_unique('courseware_xmodulesettingsfield', ['usage_id', 'field_name']) - - db.rename_table('courseware_xmoduleuserstatesummaryfield', 'courseware_xmodulecontentfield') - db.rename_column('courseware_xmodulecontentfield', 'usage_id', 'definition_id') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmoduleuserstatesummaryfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleUserStateSummaryField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0011_add_model_StudentFieldOverride.py b/lms/djangoapps/courseware/migrations/0011_add_model_StudentFieldOverride.py deleted file mode 100644 index 22bc4ae689..0000000000 --- a/lms/djangoapps/courseware/migrations/0011_add_model_StudentFieldOverride.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long - -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'StudentFieldOverride' - db.create_table('courseware_studentfieldoverride', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('location', self.gf('xmodule_django.models.LocationKeyField')(max_length=255, db_index=True)), - ('student', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('field', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('value', self.gf('django.db.models.fields.TextField')(default='null')), - )) - db.send_create_signal('courseware', ['StudentFieldOverride']) - - def backwards(self, orm): - # Deleting model 'StudentFieldOverride' - db.delete_table('courseware_studentfieldoverride') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentfieldoverride': { - 'Meta': {'unique_together': "(('course_id', 'location', 'student'),)", 'object_name': 'StudentFieldOverride'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'field': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmoduleuserstatesummaryfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleUserStateSummaryField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0012_auto__del_unique_studentfieldoverride_course_id_location_student__add_.py b/lms/djangoapps/courseware/migrations/0012_auto__del_unique_studentfieldoverride_course_id_location_student__add_.py deleted file mode 100644 index 3809138373..0000000000 --- a/lms/djangoapps/courseware/migrations/0012_auto__del_unique_studentfieldoverride_course_id_location_student__add_.py +++ /dev/null @@ -1,138 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long - -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding unique constraint on 'StudentFieldOverride', fields ['course_id', 'field', 'location', 'student'] - db.create_unique('courseware_studentfieldoverride', ['course_id', 'field', 'location', 'student_id']) - - def backwards(self, orm): - # Removing unique constraint on 'StudentFieldOverride', fields ['course_id', 'field', 'location', 'student'] - db.delete_unique('courseware_studentfieldoverride', ['course_id', 'field', 'location', 'student_id']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentfieldoverride': { - 'Meta': {'unique_together': "(('course_id', 'field', 'location', 'student'),)", 'object_name': 'StudentFieldOverride'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'field': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmoduleuserstatesummaryfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleUserStateSummaryField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0013_auto__add_field_studentfieldoverride_created__add_field_studentfieldov.py b/lms/djangoapps/courseware/migrations/0013_auto__add_field_studentfieldoverride_created__add_field_studentfieldov.py deleted file mode 100644 index 28b82c8425..0000000000 --- a/lms/djangoapps/courseware/migrations/0013_auto__add_field_studentfieldoverride_created__add_field_studentfieldov.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long - -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'StudentFieldOverride.created' - db.add_column('courseware_studentfieldoverride', 'created', - self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), - keep_default=False) - - # Adding field 'StudentFieldOverride.modified' - db.add_column('courseware_studentfieldoverride', 'modified', - self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now), - keep_default=False) - - # Adding index on 'StudentFieldOverride', fields ['course_id', 'location', 'student'] - db.create_index('courseware_studentfieldoverride', ['course_id', 'location', 'student_id']) - - def backwards(self, orm): - # Deleting field 'StudentFieldOverride.created' - db.delete_column('courseware_studentfieldoverride', 'created') - - # Deleting field 'StudentFieldOverride.modified' - db.delete_column('courseware_studentfieldoverride', 'modified') - - # Removing index on 'StudentFieldOverride', fields ['course_id', 'location', 'student'] - db.delete_index('courseware_studentfieldoverride', ['course_id', 'location', 'student_id']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'courseware.offlinecomputedgrade': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'OfflineComputedGrade'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'gradeset': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.offlinecomputedgradelog': { - 'Meta': {'ordering': "['-created']", 'object_name': 'OfflineComputedGradeLog'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'nstudents': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'seconds': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'courseware.studentfieldoverride': { - 'Meta': {'unique_together': "(('course_id', 'field', 'location', 'student'),)", 'object_name': 'StudentFieldOverride'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'field': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.studentmodule': { - 'Meta': {'unique_together': "(('student', 'module_state_key', 'course_id'),)", 'object_name': 'StudentModule'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'done': ('django.db.models.fields.CharField', [], {'default': "'na'", 'max_length': '8', 'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_state_key': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_column': "'module_id'", 'db_index': 'True'}), - 'module_type': ('django.db.models.fields.CharField', [], {'default': "'problem'", 'max_length': '32', 'db_index': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'courseware.studentmodulehistory': { - 'Meta': {'object_name': 'StudentModuleHistory'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'max_grade': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), - 'state': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'student_module': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courseware.StudentModule']"}), - 'version': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'courseware.xmodulestudentinfofield': { - 'Meta': {'unique_together': "(('student', 'field_name'),)", 'object_name': 'XModuleStudentInfoField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmodulestudentprefsfield': { - 'Meta': {'unique_together': "(('student', 'module_type', 'field_name'),)", 'object_name': 'XModuleStudentPrefsField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'module_type': ('xmodule_django.models.BlockTypeKeyField', [], {'max_length': '64', 'db_index': 'True'}), - 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - }, - 'courseware.xmoduleuserstatesummaryfield': { - 'Meta': {'unique_together': "(('usage_id', 'field_name'),)", 'object_name': 'XModuleUserStateSummaryField'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'usage_id': ('xmodule_django.models.LocationKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'value': ('django.db.models.fields.TextField', [], {'default': "'null'"}) - } - } - - complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index e849e6c1b0..2ea9b0e257 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -45,6 +45,9 @@ class ChunkingManager(models.Manager): :class:`~Manager` that adds an additional method :meth:`chunked_filter` to provide the ability to make select queries with specific chunk sizes. """ + class Meta(object): + app_label = "courseware" + def chunked_filter(self, chunk_field, items, **kwargs): """ Queries model_class with `chunk_field` set to chunks of size `chunk_size`, @@ -106,6 +109,7 @@ class StudentModule(CallStackMixin, models.Model): course_id = CourseKeyField(max_length=255, db_index=True) class Meta(object): + app_label = "courseware" unique_together = (('student', 'module_state_key', 'course_id'),) # Internal state of the object @@ -165,6 +169,7 @@ class StudentModuleHistory(CallStackMixin, models.Model): HISTORY_SAVING_TYPES = {'problem'} class Meta(object): + app_label = "courseware" get_latest_by = "created" student_module = models.ForeignKey(StudentModule, db_index=True) @@ -200,6 +205,7 @@ class XBlockFieldBase(models.Model): objects = ChunkingManager() class Meta(object): + app_label = "courseware" abstract = True # The name of the field @@ -227,6 +233,7 @@ class XModuleUserStateSummaryField(XBlockFieldBase): Stores data set in the Scope.user_state_summary scope by an xmodule field """ class Meta(object): + app_label = "courseware" unique_together = (('usage_id', 'field_name'),) # The definition id for the module @@ -238,6 +245,7 @@ class XModuleStudentPrefsField(XBlockFieldBase): Stores data set in the Scope.preferences scope by an xmodule field """ class Meta(object): + app_label = "courseware" unique_together = (('student', 'module_type', 'field_name'),) # The type of the module for these preferences @@ -251,6 +259,7 @@ class XModuleStudentInfoField(XBlockFieldBase): Stores data set in the Scope.preferences scope by an xmodule field """ class Meta(object): + app_label = "courseware" unique_together = (('student', 'field_name'),) student = models.ForeignKey(User, db_index=True) @@ -269,6 +278,7 @@ class OfflineComputedGrade(models.Model): gradeset = models.TextField(null=True, blank=True) # grades, stored as JSON class Meta(object): + app_label = "courseware" unique_together = (('user', 'course_id'), ) def __unicode__(self): @@ -281,6 +291,7 @@ class OfflineComputedGradeLog(models.Model): Use this to be able to show instructor when the last computed grades were done. """ class Meta(object): + app_label = "courseware" ordering = ["-created"] get_latest_by = "created" @@ -304,6 +315,7 @@ class StudentFieldOverride(TimeStampedModel): student = models.ForeignKey(User, db_index=True) class Meta(object): + app_label = "courseware" unique_together = (('course_id', 'field', 'location', 'student'),) field = models.CharField(max_length=255) diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index bf0decad3d..f7cc6c6bd2 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -77,7 +77,7 @@ from util.json_request import JsonResponse from util.model_utils import slugify from util.sandboxing import can_execute_unsafe_code, get_python_lib_zip from util import milestones_helpers -from verify_student.services import ReverificationService +from lms.djangoapps.verify_student.services import ReverificationService from edx_proctoring.services import ProctoringService from openedx.core.djangoapps.credit.services import CreditService @@ -1022,7 +1022,7 @@ def _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, course files = request.FILES or {} error_msg = _check_files_limits(files) if error_msg: - return JsonResponse(object={'success': error_msg}, status=413) + return JsonResponse({'success': error_msg}, status=413) # Make a CourseKey from the course_id, raising a 404 upon parse error. try: @@ -1065,7 +1065,7 @@ def _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, course except ProcessingError as err: log.warning("Module encountered an error while processing AJAX call", exc_info=True) - return JsonResponse(object={'success': err.args[0]}, status=200) + return JsonResponse({'success': err.args[0]}, status=200) # If any other error occurred, re-raise it to trigger a 500 response except Exception: diff --git a/lms/djangoapps/courseware/tests/__init__.py b/lms/djangoapps/courseware/tests/__init__.py index 9259f4ceb2..383a1b8c99 100644 --- a/lms/djangoapps/courseware/tests/__init__.py +++ b/lms/djangoapps/courseware/tests/__init__.py @@ -85,7 +85,7 @@ class BaseTestXmodule(ModuleStoreTestCase): #self.item_module = self.item_descriptor.xmodule_runtime.xmodule_instance #self.item_module is None at this time - self.item_url = self.item_descriptor.location.to_deprecated_string() + self.item_url = unicode(self.item_descriptor.location) def setup_course(self): self.course = CourseFactory.create(data=self.COURSE_DATA) @@ -131,7 +131,7 @@ class BaseTestXmodule(ModuleStoreTestCase): """Return item url with dispatch.""" return reverse( 'xblock_handler', - args=(self.course.id.to_deprecated_string(), quote_slashes(self.item_url), 'xmodule_handler', dispatch) + args=(unicode(self.course.id), quote_slashes(self.item_url), 'xmodule_handler', dispatch) ) diff --git a/lms/djangoapps/courseware/tests/test_comp_theming.py b/lms/djangoapps/courseware/tests/test_comp_theming.py index 66f930eeef..65803687b4 100644 --- a/lms/djangoapps/courseware/tests/test_comp_theming.py +++ b/lms/djangoapps/courseware/tests/test_comp_theming.py @@ -18,7 +18,7 @@ class TestComprehensiveTheming(TestCase): super(TestComprehensiveTheming, self).setUp() # Clear the internal staticfiles caches, to get test isolation. - staticfiles.finders._finders.clear() # pylint: disable=protected-access + staticfiles.finders.get_finder.cache_clear() @with_comp_theme(settings.REPO_ROOT / 'themes/red-theme') @unittest.skip("Disabled until we can release theming to production") diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index 9feb521a23..1c9217d495 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -142,7 +142,7 @@ class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest self.assertEqual(resp.status_code, 200) def test_num_queries_instructor_paced(self): - self.fetch_course_info_with_queries(self.instructor_paced_course, 14, 4) + self.fetch_course_info_with_queries(self.instructor_paced_course, 17, 4) def test_num_queries_self_paced(self): - self.fetch_course_info_with_queries(self.self_paced_course, 14, 4) + self.fetch_course_info_with_queries(self.self_paced_course, 17, 4) diff --git a/lms/djangoapps/courseware/tests/test_date_summary.py b/lms/djangoapps/courseware/tests/test_date_summary.py index 4dae6f4d5f..965c295460 100644 --- a/lms/djangoapps/courseware/tests/test_date_summary.py +++ b/lms/djangoapps/courseware/tests/test_date_summary.py @@ -21,8 +21,8 @@ from courseware.date_summary import ( ) from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from student.tests.factories import CourseEnrollmentFactory, UserFactory -from verify_student.models import VerificationDeadline -from verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory +from lms.djangoapps.verify_student.models import VerificationDeadline +from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory diff --git a/lms/djangoapps/courseware/tests/test_model_data.py b/lms/djangoapps/courseware/tests/test_model_data.py index 38b51b9fdf..e8c2a275f1 100644 --- a/lms/djangoapps/courseware/tests/test_model_data.py +++ b/lms/djangoapps/courseware/tests/test_model_data.py @@ -249,7 +249,7 @@ class TestMissingStudentModule(TestCase): # to discover if something other than the DjangoXBlockUserStateClient # has written to the StudentModule (such as UserStateCache setting the score # on the StudentModule). - with self.assertNumQueries(3): + with self.assertNumQueries(5): self.kvs.set(user_state_key('a_field'), 'a_value') self.assertEquals(1, sum(len(cache) for cache in self.field_data_cache.cache.values())) diff --git a/lms/djangoapps/courseware/tests/test_video_handlers.py b/lms/djangoapps/courseware/tests/test_video_handlers.py index 7db94a718e..72356c1cce 100644 --- a/lms/djangoapps/courseware/tests/test_video_handlers.py +++ b/lms/djangoapps/courseware/tests/test_video_handlers.py @@ -145,12 +145,12 @@ class TestVideo(BaseTestXmodule): def test_handle_ajax(self): data = [ - {'speed': 2.0}, - {'saved_video_position': "00:00:10"}, - {'transcript_language': 'uk'}, - {'bumper_do_not_show_again': True}, - {'bumper_last_view_date': True}, - {'demoo�': 'sample'} + {u'speed': 2.0}, + {u'saved_video_position': "00:00:10"}, + {u'transcript_language': 'uk'}, + {u'bumper_do_not_show_again': True}, + {u'bumper_last_view_date': True}, + {u'demoo�': 'sample'} ] for sample in data: response = self.clients[self.users[0].username].post( diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index e32d3078a4..4a87ae8887 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -818,7 +818,7 @@ class ProgressPageTests(ModuleStoreTestCase): self.assertContains(resp, u"Download Your Certificate") @ddt.data( - *itertools.product(((18, 4, True), (18, 4, False)), (True, False)) + *itertools.product(((38, 4, True), (38, 4, False)), (True, False)) ) @ddt.unpack def test_query_counts(self, (sql_calls, mongo_calls, self_paced), self_paced_enabled): diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 047372d1f8..34c88ec76b 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -15,6 +15,7 @@ from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.decorators import login_required +from django.db import transaction from django.utils.timezone import UTC from django.views.decorators.http import require_GET, require_POST, require_http_methods from django.http import Http404, HttpResponse, HttpResponseBadRequest @@ -23,7 +24,6 @@ from certificates import api as certs_api from edxmako.shortcuts import render_to_response, render_to_string, marketing_link from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.cache import cache_control -from django.db import transaction from markupsafe import escape from courseware import grades @@ -61,6 +61,7 @@ from student.models import UserTestGroup, CourseEnrollment from student.views import is_course_blocked from util.cache import cache, cache_if_anonymous from util.date_utils import strftime_localized +from util.db import outer_atomic from xblock.fragment import Fragment from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem @@ -77,8 +78,6 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.keys import CourseKey, UsageKey from instructor.enrollment import uses_shib -from util.db import commit_on_success_with_read_committed - import survey.utils import survey.views @@ -281,11 +280,12 @@ def save_positions_recursively_up(user, request, field_data_cache, xmodule, cour current_module = parent +@transaction.non_atomic_requests @login_required @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @ensure_valid_course_key -@commit_on_success_with_read_committed +@outer_atomic(read_committed=True) def index(request, course_id, chapter=None, section=None, position=None): """ @@ -879,21 +879,17 @@ def course_about(request, course_id): }) +@transaction.non_atomic_requests @login_required @cache_control(no_cache=True, no_store=True, must_revalidate=True) -@transaction.commit_manually @ensure_valid_course_key def progress(request, course_id, student_id=None): - """ - Wraps "_progress" with the manual_transaction context manager just in case - there are unanticipated errors. - """ + """ Display the progress page. """ course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) with modulestore().bulk_operations(course_key): - with grades.manual_transaction(): - return _progress(request, course_key, student_id) + return _progress(request, course_key, student_id) def _progress(request, course_key, student_id): @@ -932,8 +928,11 @@ def _progress(request, course_key, student_id): # The pre-fetching of groups is done to make auth checks not require an # additional DB lookup (this kills the Progress page in particular). student = User.objects.prefetch_related("groups").get(id=student.id) - field_data_cache = grades.field_data_cache_for_grading(course, student) - scores_client = ScoresClient.from_field_data_cache(field_data_cache) + + with outer_atomic(): + field_data_cache = grades.field_data_cache_for_grading(course, student) + scores_client = ScoresClient.from_field_data_cache(field_data_cache) + courseware_summary = grades.progress_summary( student, request, course, field_data_cache=field_data_cache, scores_client=scores_client ) @@ -982,7 +981,7 @@ def _progress(request, course_key, student_id): 'download_url': None }) - with grades.manual_transaction(): + with outer_atomic(): response = render_to_response('courseware/progress.html', context) return response @@ -1275,6 +1274,8 @@ def is_course_passed(course, grade_summary=None, student=None, request=None): return success_cutoff and grade_summary['percent'] >= success_cutoff +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @require_POST def generate_user_cert(request, course_id): """Start generating a new certificate for the user. diff --git a/lms/djangoapps/dashboard/management/commands/git_add_course.py b/lms/djangoapps/dashboard/management/commands/git_add_course.py index c48d854d66..fad6b5e10e 100644 --- a/lms/djangoapps/dashboard/management/commands/git_add_course.py +++ b/lms/djangoapps/dashboard/management/commands/git_add_course.py @@ -29,29 +29,26 @@ class Command(BaseCommand): '\n{0}'.format(_('Import the specified git repository and optional branch into the ' 'modulestore and optionally specified directory.'))) + def add_arguments(self, parser): + # Positional arguments + parser.add_argument('repository_url') + parser.add_argument('--directory_path', action='store') + parser.add_argument('--repository_branch', action='store') + def handle(self, *args, **options): """Check inputs and run the command""" if isinstance(modulestore, XMLModuleStore): raise CommandError('This script requires a mongo module store') - if len(args) < 1: - raise CommandError('This script requires at least one argument, ' - 'the git URL') - - if len(args) > 3: - raise CommandError('Expected no more than three ' - 'arguments; received {0}'.format(len(args))) - rdir_arg = None branch = None - - if len(args) > 1: - rdir_arg = args[1] - if len(args) > 2: - branch = args[2] + if options['directory_path']: + rdir_arg = options['directory_path'] + if options['repository_branch']: + branch = options['repository_branch'] try: - dashboard.git_import.add_repo(args[0], rdir_arg, branch) + dashboard.git_import.add_repo(options['repository_url'], rdir_arg, branch) except GitImportError as ex: raise CommandError(str(ex)) diff --git a/lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py b/lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py index f749834259..d2da5a1417 100644 --- a/lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py +++ b/lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py @@ -52,22 +52,22 @@ class TestGitAddCourse(ModuleStoreTestCase): """ Convenience function for testing command failures """ - with self.assertRaises(SystemExit): - with self.assertRaisesRegexp(CommandError, regex): - call_command('git_add_course', *args, - stderr=StringIO.StringIO()) + with self.assertRaisesRegexp(CommandError, regex): + call_command('git_add_course', *args, stderr=StringIO.StringIO()) def test_command_args(self): """ Validate argument checking """ + # No argument given. + self.assertCommandFailureRegexp('Error: too few arguments') + # Extra/Un-named arguments given. self.assertCommandFailureRegexp( - 'This script requires at least one argument, the git URL') - self.assertCommandFailureRegexp( - 'Expected no more than three arguments; recieved 4', + 'Error: unrecognized arguments: blah blah blah', 'blah', 'blah', 'blah', 'blah') + # Not a valid path. self.assertCommandFailureRegexp( - 'Repo was not added, check log output for details', + 'Path {0} doesn\'t exist, please create it,'.format(self.GIT_REPO_DIR), 'blah') # Test successful import from command if not os.path.isdir(self.GIT_REPO_DIR): @@ -80,12 +80,12 @@ class TestGitAddCourse(ModuleStoreTestCase): os.mkdir(self.GIT_REPO_DIR / 'edx4edx') call_command('git_add_course', self.TEST_REPO, - self.GIT_REPO_DIR / 'edx4edx_lite') + directory_path=self.GIT_REPO_DIR / 'edx4edx_lite') # Test with all three args (branch) call_command('git_add_course', self.TEST_REPO, - self.GIT_REPO_DIR / 'edx4edx_lite', - self.TEST_BRANCH) + directory_path=self.GIT_REPO_DIR / 'edx4edx_lite', + repository_branch=self.TEST_BRANCH) def test_add_repo(self): """ diff --git a/lms/djangoapps/dashboard/sysadmin.py b/lms/djangoapps/dashboard/sysadmin.py index fa72795a30..f175d51328 100644 --- a/lms/djangoapps/dashboard/sysadmin.py +++ b/lms/djangoapps/dashboard/sysadmin.py @@ -107,7 +107,7 @@ class SysadminDashboardView(TemplateView): writer.writerow(row) csv_data = read_and_flush() yield csv_data - response = HttpResponse(csv_data(), mimetype='text/csv') + response = HttpResponse(csv_data(), content_type='text/csv') response['Content-Disposition'] = 'attachment; filename={0}'.format( filename) return response diff --git a/lms/djangoapps/django_comment_client/base/tests.py b/lms/djangoapps/django_comment_client/base/tests.py index 3e0dfd8129..e9ee82d712 100644 --- a/lms/djangoapps/django_comment_client/base/tests.py +++ b/lms/djangoapps/django_comment_client/base/tests.py @@ -5,7 +5,7 @@ import json import ddt from django.conf import settings -from django.core.cache import get_cache +from django.core.cache import caches from django.test.client import Client, RequestFactory from django.contrib.auth.models import User from django.core.management import call_command @@ -24,7 +24,7 @@ from django_comment_client.tests.unicode import UnicodeTestMixin from django_comment_common.models import Role from django_comment_common.utils import seed_permissions_roles, ThreadContext from student.tests.factories import CourseEnrollmentFactory, UserFactory, CourseAccessRoleFactory -from teams.tests.factories import CourseTeamFactory, CourseTeamMembershipFactory +from lms.djangoapps.teams.tests.factories import CourseTeamFactory, CourseTeamMembershipFactory from util.testing import UrlResetMixin from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -360,7 +360,7 @@ class ViewsQueryCountTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSet def clear_caches(self): """Clears caches so that query count numbers are accurate.""" for cache in settings.CACHES: - get_cache(cache).clear() + caches[cache].clear() RequestCache.clear_request_cache() def count_queries(func): # pylint: disable=no-self-argument @@ -378,10 +378,10 @@ class ViewsQueryCountTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSet return inner @ddt.data( - (ModuleStoreEnum.Type.mongo, 3, 4, 22), - (ModuleStoreEnum.Type.mongo, 20, 4, 22), - (ModuleStoreEnum.Type.split, 3, 13, 22), - (ModuleStoreEnum.Type.split, 20, 13, 22), + (ModuleStoreEnum.Type.mongo, 3, 4, 26), + (ModuleStoreEnum.Type.mongo, 20, 4, 26), + (ModuleStoreEnum.Type.split, 3, 13, 26), + (ModuleStoreEnum.Type.split, 20, 13, 26), ) @ddt.unpack @count_queries @@ -389,10 +389,10 @@ class ViewsQueryCountTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSet self.create_thread_helper(mock_request) @ddt.data( - (ModuleStoreEnum.Type.mongo, 3, 3, 16), - (ModuleStoreEnum.Type.mongo, 20, 3, 16), - (ModuleStoreEnum.Type.split, 3, 10, 16), - (ModuleStoreEnum.Type.split, 20, 10, 16), + (ModuleStoreEnum.Type.mongo, 3, 3, 20), + (ModuleStoreEnum.Type.mongo, 20, 3, 20), + (ModuleStoreEnum.Type.split, 3, 10, 20), + (ModuleStoreEnum.Type.split, 20, 10, 20), ) @ddt.unpack @count_queries diff --git a/lms/djangoapps/django_comment_client/base/urls.py b/lms/djangoapps/django_comment_client/base/urls.py index e49278ad7c..f3a2f9244a 100644 --- a/lms/djangoapps/django_comment_client/base/urls.py +++ b/lms/djangoapps/django_comment_client/base/urls.py @@ -1,4 +1,7 @@ -from django.conf.urls.defaults import url, patterns +""" +Base urls for the django_comment_client. +""" +from django.conf.urls import url, patterns urlpatterns = patterns( 'django_comment_client.base.views', diff --git a/lms/djangoapps/django_comment_client/forum/tests.py b/lms/djangoapps/django_comment_client/forum/tests.py index a2db0d5569..7d12715ef0 100644 --- a/lms/djangoapps/django_comment_client/forum/tests.py +++ b/lms/djangoapps/django_comment_client/forum/tests.py @@ -35,7 +35,7 @@ from mock import patch, Mock, ANY, call from openedx.core.djangoapps.course_groups.models import CourseUserGroup -from teams.tests.factories import CourseTeamFactory +from lms.djangoapps.teams.tests.factories import CourseTeamFactory log = logging.getLogger(__name__) @@ -337,11 +337,11 @@ class SingleThreadQueryCountTestCase(ModuleStoreTestCase): @ddt.data( # old mongo with cache - (ModuleStoreEnum.Type.mongo, 1, 6, 4, 14, 8), - (ModuleStoreEnum.Type.mongo, 50, 6, 4, 14, 8), + (ModuleStoreEnum.Type.mongo, 1, 6, 4, 16, 8), + (ModuleStoreEnum.Type.mongo, 50, 6, 4, 16, 8), # split mongo: 3 queries, regardless of thread response size. - (ModuleStoreEnum.Type.split, 1, 3, 3, 14, 8), - (ModuleStoreEnum.Type.split, 50, 3, 3, 14, 8), + (ModuleStoreEnum.Type.split, 1, 3, 3, 16, 8), + (ModuleStoreEnum.Type.split, 50, 3, 3, 16, 8), ) @ddt.unpack def test_number_of_mongo_queries( diff --git a/lms/djangoapps/django_comment_client/forum/urls.py b/lms/djangoapps/django_comment_client/forum/urls.py index cb11d99571..7064858ed5 100644 --- a/lms/djangoapps/django_comment_client/forum/urls.py +++ b/lms/djangoapps/django_comment_client/forum/urls.py @@ -1,4 +1,7 @@ -from django.conf.urls.defaults import url, patterns +""" +Forum urls for the django_comment_client. +""" +from django.conf.urls import url, patterns urlpatterns = patterns( 'django_comment_client.forum.views', diff --git a/lms/djangoapps/django_comment_client/migrations/0001_initial.py b/lms/djangoapps/django_comment_client/migrations/0001_initial.py deleted file mode 100644 index 0b5f88e2f2..0000000000 --- a/lms/djangoapps/django_comment_client/migrations/0001_initial.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Role' - db.create_table('django_comment_client_role', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), - ('course_id', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, blank=True)), - )) - db.send_create_signal('django_comment_client', ['Role']) - - # Adding M2M table for field users on 'Role' - db.create_table('django_comment_client_role_users', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('role', models.ForeignKey(orm['django_comment_client.role'], null=False)), - ('user', models.ForeignKey(orm['auth.user'], null=False)) - )) - db.create_unique('django_comment_client_role_users', ['role_id', 'user_id']) - - # Adding model 'Permission' - db.create_table('django_comment_client_permission', ( - ('name', self.gf('django.db.models.fields.CharField')(max_length=30, primary_key=True)), - )) - db.send_create_signal('django_comment_client', ['Permission']) - - # Adding M2M table for field roles on 'Permission' - db.create_table('django_comment_client_permission_roles', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('permission', models.ForeignKey(orm['django_comment_client.permission'], null=False)), - ('role', models.ForeignKey(orm['django_comment_client.role'], null=False)) - )) - db.create_unique('django_comment_client_permission_roles', ['permission_id', 'role_id']) - - - def backwards(self, orm): - # Deleting model 'Role' - db.delete_table('django_comment_client_role') - - # Removing M2M table for field users on 'Role' - db.delete_table('django_comment_client_role_users') - - # Deleting model 'Permission' - db.delete_table('django_comment_client_permission') - - # Removing M2M table for field roles on 'Permission' - db.delete_table('django_comment_client_permission_roles') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'django_comment_client.permission': { - 'Meta': {'object_name': 'Permission'}, - 'name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'primary_key': 'True'}), - 'roles': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'permissions'", 'symmetrical': 'False', 'to': "orm['django_comment_client.Role']"}) - }, - 'django_comment_client.role': { - 'Meta': {'object_name': 'Role'}, - 'course_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'roles'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['django_comment_client'] diff --git a/lms/djangoapps/django_comment_client/permissions.py b/lms/djangoapps/django_comment_client/permissions.py index 5770ac6817..c9a3910930 100644 --- a/lms/djangoapps/django_comment_client/permissions.py +++ b/lms/djangoapps/django_comment_client/permissions.py @@ -10,7 +10,7 @@ from lms.lib.comment_client import Thread from opaque_keys.edx.keys import CourseKey from django_comment_common.models import all_permissions_for_user_in_course -from teams.models import CourseTeam +from lms.djangoapps.teams.models import CourseTeam def has_permission(user, permission, course_id=None): diff --git a/lms/djangoapps/django_comment_client/tests/group_id.py b/lms/djangoapps/django_comment_client/tests/group_id.py index f5eca815d3..1c8eea1c2d 100644 --- a/lms/djangoapps/django_comment_client/tests/group_id.py +++ b/lms/djangoapps/django_comment_client/tests/group_id.py @@ -1,6 +1,6 @@ import json import re -from teams.tests.factories import CourseTeamFactory +from lms.djangoapps.teams.tests.factories import CourseTeamFactory class GroupIdAssertionMixin(object): diff --git a/lms/djangoapps/django_comment_client/tests/test_utils.py b/lms/djangoapps/django_comment_client/tests/test_utils.py index 241ae24cf4..b8762232f8 100644 --- a/lms/djangoapps/django_comment_client/tests/test_utils.py +++ b/lms/djangoapps/django_comment_client/tests/test_utils.py @@ -27,7 +27,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE from xmodule.modulestore.django import modulestore from opaque_keys.edx.locator import CourseLocator -from teams.tests.factories import CourseTeamFactory +from lms.djangoapps.teams.tests.factories import CourseTeamFactory @attr('shard_1') diff --git a/lms/djangoapps/django_comment_client/urls.py b/lms/djangoapps/django_comment_client/urls.py index eee27ada4b..03e18b38c2 100644 --- a/lms/djangoapps/django_comment_client/urls.py +++ b/lms/djangoapps/django_comment_client/urls.py @@ -1,4 +1,7 @@ -from django.conf.urls.defaults import url, patterns, include +""" +Urls for the django_comment_client. +""" +from django.conf.urls import url, patterns, include urlpatterns = patterns( '', diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index 0807a66fa8..1b73a0bf20 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -431,7 +431,7 @@ class JsonResponse(HttpResponse): """ content = json.dumps(data, cls=i4xEncoder) super(JsonResponse, self).__init__(content, - mimetype='application/json; charset=utf-8') + content_type='application/json; charset=utf-8') class JsonError(HttpResponse): @@ -446,7 +446,7 @@ class JsonError(HttpResponse): error_messages = [error_messages] content = json.dumps({'errors': error_messages}, indent=2, ensure_ascii=False) super(JsonError, self).__init__(content, - mimetype='application/json; charset=utf-8', status=status) + content_type='application/json; charset=utf-8', status=status) class HtmlResponse(HttpResponse): diff --git a/lms/djangoapps/foldit/migrations/0001_initial.py b/lms/djangoapps/foldit/migrations/0001_initial.py index d288e51742..e73af4e039 100644 --- a/lms/djangoapps/foldit/migrations/0001_initial.py +++ b/lms/djangoapps/foldit/migrations/0001_initial.py @@ -1,111 +1,47 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'Score' - db.create_table('foldit_score', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='foldit_scores', to=orm['auth.User'])), - ('unique_user_id', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('puzzle_id', self.gf('django.db.models.fields.IntegerField')()), - ('best_score', self.gf('django.db.models.fields.FloatField')(db_index=True)), - ('current_score', self.gf('django.db.models.fields.FloatField')(db_index=True)), - ('score_version', self.gf('django.db.models.fields.IntegerField')()), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - )) - db.send_create_signal('foldit', ['Score']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'PuzzleComplete' - db.create_table('foldit_puzzlecomplete', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='foldit_puzzles_complete', to=orm['auth.User'])), - ('unique_user_id', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('puzzle_id', self.gf('django.db.models.fields.IntegerField')()), - ('puzzle_set', self.gf('django.db.models.fields.IntegerField')(db_index=True)), - ('puzzle_subset', self.gf('django.db.models.fields.IntegerField')(db_index=True)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - )) - db.send_create_signal('foldit', ['PuzzleComplete']) - - # Adding unique constraint on 'PuzzleComplete', fields ['user', 'puzzle_id', 'puzzle_set', 'puzzle_subset'] - db.create_unique('foldit_puzzlecomplete', ['user_id', 'puzzle_id', 'puzzle_set', 'puzzle_subset']) - - - def backwards(self, orm): - # Removing unique constraint on 'PuzzleComplete', fields ['user', 'puzzle_id', 'puzzle_set', 'puzzle_subset'] - db.delete_unique('foldit_puzzlecomplete', ['user_id', 'puzzle_id', 'puzzle_set', 'puzzle_subset']) - - # Deleting model 'Score' - db.delete_table('foldit_score') - - # Deleting model 'PuzzleComplete' - db.delete_table('foldit_puzzlecomplete') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'foldit.puzzlecomplete': { - 'Meta': {'ordering': "['puzzle_id']", 'unique_together': "(('user', 'puzzle_id', 'puzzle_set', 'puzzle_subset'),)", 'object_name': 'PuzzleComplete'}, - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'puzzle_id': ('django.db.models.fields.IntegerField', [], {}), - 'puzzle_set': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), - 'puzzle_subset': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), - 'unique_user_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'foldit_puzzles_complete'", 'to': "orm['auth.User']"}) - }, - 'foldit.score': { - 'Meta': {'object_name': 'Score'}, - 'best_score': ('django.db.models.fields.FloatField', [], {'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'current_score': ('django.db.models.fields.FloatField', [], {'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'puzzle_id': ('django.db.models.fields.IntegerField', [], {}), - 'score_version': ('django.db.models.fields.IntegerField', [], {}), - 'unique_user_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'foldit_scores'", 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['foldit'] + operations = [ + migrations.CreateModel( + name='PuzzleComplete', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('unique_user_id', models.CharField(max_length=50, db_index=True)), + ('puzzle_id', models.IntegerField()), + ('puzzle_set', models.IntegerField(db_index=True)), + ('puzzle_subset', models.IntegerField(db_index=True)), + ('created', models.DateTimeField(auto_now_add=True)), + ('user', models.ForeignKey(related_name='foldit_puzzles_complete', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['puzzle_id'], + }, + ), + migrations.CreateModel( + name='Score', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('unique_user_id', models.CharField(max_length=50, db_index=True)), + ('puzzle_id', models.IntegerField()), + ('best_score', models.FloatField(db_index=True)), + ('current_score', models.FloatField(db_index=True)), + ('score_version', models.IntegerField()), + ('created', models.DateTimeField(auto_now_add=True)), + ('user', models.ForeignKey(related_name='foldit_scores', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AlterUniqueTogether( + name='puzzlecomplete', + unique_together=set([('user', 'puzzle_id', 'puzzle_set', 'puzzle_subset')]), + ), + ] diff --git a/lms/djangoapps/instructor/tests/test_enrollment.py b/lms/djangoapps/instructor/tests/test_enrollment.py index 231eb533bd..1463d0b4ce 100644 --- a/lms/djangoapps/instructor/tests/test_enrollment.py +++ b/lms/djangoapps/instructor/tests/test_enrollment.py @@ -18,7 +18,7 @@ from student.tests.factories import UserFactory from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from ccx.tests.factories import CcxFactory +from lms.djangoapps.ccx.tests.factories import CcxFactory from student.models import CourseEnrollment, CourseEnrollmentAllowed from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error diff --git a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py index aa9b09abfb..7f930ea7d2 100644 --- a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py +++ b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py @@ -140,7 +140,6 @@ class TestLetterCutoffPolicy(TestGradebook): self.assertIn("grade_D {color:DarkSlateGray;}", self.response.content) def test_assigned_grades(self): - print self.response.content # Users 9-10 have >= 90% on Homeworks [2] # Users 9-10 have >= 90% on the class [2] # One use at the top of the page [1] diff --git a/lms/djangoapps/instructor/tests/test_tools.py b/lms/djangoapps/instructor/tests/test_tools.py index 9ea90f6773..371e7f76a7 100644 --- a/lms/djangoapps/instructor/tests/test_tools.py +++ b/lms/djangoapps/instructor/tests/test_tools.py @@ -242,7 +242,7 @@ class TestSetDueDateExtension(ModuleStoreTestCase): def test_set_due_date_extension_num_queries(self): extended = datetime.datetime(2013, 12, 25, 0, 0, tzinfo=utc) - with self.assertNumQueries(4): + with self.assertNumQueries(5): tools.set_due_date_extension(self.course, self.week1, self.user, extended) self._clear_field_data_cache() diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 598e37181c..4539d51ad2 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -17,14 +17,15 @@ from django.views.decorators.http import require_POST from django.views.decorators.cache import cache_control from django.core.exceptions import ValidationError, PermissionDenied from django.core.mail.message import EmailMessage -from django.db import IntegrityError from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned +from django.db import IntegrityError, transaction from django.core.urlresolvers import reverse from django.core.validators import validate_email from django.utils.translation import ugettext as _ from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotFound from django.utils.html import strip_tags from django.shortcuts import redirect +from util.db import outer_atomic import string # pylint: disable=deprecated-module import random import unicodecsv @@ -439,11 +440,12 @@ def register_and_enroll_students(request, course_id): # pylint: disable=too-man password = generate_unique_password(generated_passwords) try: - enrollment_obj = create_and_enroll_user(email, username, name, country, password, course_id) - reason = 'Enrolling via csv upload' - ManualEnrollmentAudit.create_manual_enrollment_audit( - request.user, email, UNENROLLED_TO_ENROLLED, reason, enrollment_obj - ) + with transaction.atomic(): + enrollment_obj = create_and_enroll_user(email, username, name, country, password, course_id) + reason = 'Enrolling via csv upload' + ManualEnrollmentAudit.create_manual_enrollment_audit( + request.user, email, UNENROLLED_TO_ENROLLED, reason, enrollment_obj + ) except IntegrityError: row_errors.append({ 'username': username, 'email': email, 'response': _('Username {user} already exists.').format(user=username)}) @@ -889,6 +891,7 @@ def list_course_role_members(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1091,6 +1094,7 @@ def re_validate_invoice(obj_invoice): return JsonResponse({'message': message}) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1130,6 +1134,7 @@ def get_issued_certificates(request, course_id): # pylint: disable=invalid-name return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1208,6 +1213,7 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red return JsonResponse({"status": already_running_status}) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1239,6 +1245,7 @@ def get_students_who_may_enroll(request, course_id): return JsonResponse({"status": already_running_status}) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_POST @@ -1313,6 +1320,7 @@ def get_coupon_codes(request, course_id): # pylint: disable=unused-argument return instructor_analytics.csvs.create_csv_response('Coupons.csv', csv_columns, data_rows) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1336,6 +1344,7 @@ def get_enrollment_report(request, course_id): }) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1360,6 +1369,7 @@ def get_exec_summary_report(request, course_id): }) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1383,6 +1393,7 @@ def get_course_survey_results(request, course_id): }) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1452,7 +1463,8 @@ def save_registration_code(user, course_id, mode_slug, invoice=None, order=None, invoice_item=invoice_item ) try: - course_registration.save() + with transaction.atomic(): + course_registration.save() return course_registration except IntegrityError: return save_registration_code( @@ -1767,7 +1779,7 @@ def get_anon_ids(request, course_id): # pylint: disable=unused-argument def csv_response(filename, header, rows): """Returns a CSV http response for the given header and rows (excel/utf-8).""" - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename={0}'.format(unicode(filename).encode('utf-8')) writer = csv.writer(response, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL) # In practice, there should not be non-ascii data in this query, @@ -1816,6 +1828,7 @@ def get_student_progress_url(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1897,6 +1910,7 @@ def reset_student_attempts(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -1962,6 +1976,7 @@ def reset_student_attempts_for_entrance_exam(request, course_id): # pylint: dis return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('instructor') @@ -2017,6 +2032,7 @@ def rescore_problem(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('instructor') @@ -2223,6 +2239,7 @@ def list_financial_report_downloads(_request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -2245,6 +2262,7 @@ def calculate_grades_csv(request, course_id): }) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -2333,6 +2351,7 @@ def list_forum_members(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -2624,6 +2643,51 @@ def enable_certificate_generation(request, course_id=None): return redirect(_instructor_dash_url(course_key, section='certificates')) +<<<<<<< HEAD +======= +#---- Gradebook (shown to small courses only) ---- +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests +@cache_control(no_cache=True, no_store=True, must_revalidate=True) +@require_level('staff') +def spoc_gradebook(request, course_id): + """ + Show the gradebook for this course: + - Only shown for courses with enrollment < settings.FEATURES.get("MAX_ENROLLMENT_INSTR_BUTTONS") + - Only displayed to course staff + """ + course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) + course = get_course_with_access(request.user, 'staff', course_key, depth=None) + + enrolled_students = User.objects.filter( + courseenrollment__course_id=course_key, + courseenrollment__is_active=1 + ).order_by('username').select_related("profile") + + # possible extension: implement pagination to show to large courses + + student_info = [ + { + 'username': student.username, + 'id': student.id, + 'email': student.email, + 'grade_summary': student_grades(student, request, course), + 'realname': student.profile.name, + } + for student in enrolled_students + ] + + return render_to_response('courseware/gradebook.html', { + 'students': student_info, + 'course': course, + 'course_id': course_key, + # Checked above + 'staff_access': True, + 'ordered_grades': sorted(course.grade_cutoffs.items(), key=lambda i: i[1], reverse=True), + }) + + +>>>>>>> origin/release @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @@ -2648,6 +2712,7 @@ def mark_student_can_skip_entrance_exam(request, course_id): # pylint: disable= return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_global_staff @@ -2667,6 +2732,7 @@ def start_certificate_generation(request, course_id): return JsonResponse(response_payload) +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_global_staff @@ -2721,13 +2787,15 @@ def create_certificate_exception(request, course_id, white_list_student=None): 'success': False, 'message': _('Invalid Json data') }, status=400) - try: - certificate_white_list, students = process_certificate_exceptions(certificate_white_list, course_key) - except ValueError as error: - return JsonResponse( - {'success': False, 'message': error.message, 'data': json.dumps(certificate_white_list)}, - status=400 - ) + + with outer_atomic(): + try: + certificate_white_list, students = process_certificate_exceptions(certificate_white_list, course_key) + except ValueError as error: + return JsonResponse( + {'success': False, 'message': error.message, 'data': json.dumps(certificate_white_list)}, + status=400 + ) if white_list_student == 'all': # Generate Certificates for all white listed students diff --git a/lms/djangoapps/instructor/views/legacy.py b/lms/djangoapps/instructor/views/legacy.py index f93dfd06c6..6b30a6ee57 100644 --- a/lms/djangoapps/instructor/views/legacy.py +++ b/lms/djangoapps/instructor/views/legacy.py @@ -20,6 +20,7 @@ from StringIO import StringIO from django.conf import settings from django.contrib.auth.models import User +from django.db import transaction from django.http import HttpResponse from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.cache import cache_control @@ -77,6 +78,8 @@ def split_by_comma_and_whitespace(a_str): return re.split(r'[\s,]', a_str) +# Grades can potentially be written - if so, let grading manage the transaction. +@transaction.non_atomic_requests @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) def instructor_dashboard(request, course_id): @@ -129,7 +132,7 @@ def instructor_dashboard(request, course_id): def return_csv(func, datatable, file_pointer=None): """Outputs a CSV file from the contents of a datatable.""" if file_pointer is None: - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = (u'attachment; filename={0}'.format(func)).encode('utf-8') else: response = file_pointer diff --git a/lms/djangoapps/instructor_analytics/csvs.py b/lms/djangoapps/instructor_analytics/csvs.py index eb4cf69e30..e2c34041df 100644 --- a/lms/djangoapps/instructor_analytics/csvs.py +++ b/lms/djangoapps/instructor_analytics/csvs.py @@ -15,7 +15,7 @@ def create_csv_response(filename, header, datarows): header e.g. ['Name', 'Email'] datarows e.g. [['Jim', 'jim@edy.org'], ['Jake', 'jake@edy.org'], ...] """ - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename={0}'\ .format(filename) csvwriter = csv.writer( diff --git a/lms/djangoapps/instructor_task/api.py b/lms/djangoapps/instructor_task/api.py index 703c54b4c1..501ebaae10 100644 --- a/lms/djangoapps/instructor_task/api.py +++ b/lms/djangoapps/instructor_task/api.py @@ -95,14 +95,6 @@ def submit_rescore_problem_for_student(request, usage_key, student): # pylint: ItemNotFoundException is raised if the problem doesn't exist, or AlreadyRunningError if the problem is already being rescored for this student, or NotImplementedError if the problem doesn't support rescoring. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. - """ # check arguments: let exceptions return up to the caller. check_arguments_for_rescoring(usage_key) @@ -125,13 +117,6 @@ def submit_rescore_problem_for_all_students(request, usage_key): # pylint: disa ItemNotFoundException is raised if the problem doesn't exist, or AlreadyRunningError if the problem is already being rescored, or NotImplementedError if the problem doesn't support rescoring. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check arguments: let exceptions return up to the caller. check_arguments_for_rescoring(usage_key) @@ -157,13 +142,6 @@ def submit_rescore_entrance_exam_for_student(request, usage_key, student=None): usage_key, AlreadyRunningError is raised if the entrance exam is already being re-scored, or NotImplementedError if the problem doesn't support rescoring. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check problems for rescoring: let exceptions return up to the caller. check_entrance_exam_problems_for_rescoring(usage_key) @@ -185,13 +163,6 @@ def submit_reset_problem_attempts_for_all_students(request, usage_key): # pylin ItemNotFoundException is raised if the problem doesn't exist, or AlreadyRunningError if the problem is already being reset. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check arguments: make sure that the usage_key is defined # (since that's currently typed in). If the corresponding module descriptor doesn't exist, @@ -218,13 +189,6 @@ def submit_reset_problem_attempts_in_entrance_exam(request, usage_key, student): ItemNotFoundError is raised if entrance exam does not exists for given usage_key, AlreadyRunningError is raised if the entrance exam is already being reset. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check arguments: make sure entrance exam(section) exists for given usage_key modulestore().get_item(usage_key) @@ -245,13 +209,6 @@ def submit_delete_problem_state_for_all_students(request, usage_key): # pylint: ItemNotFoundException is raised if the problem doesn't exist, or AlreadyRunningError if the particular problem's state is already being deleted. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check arguments: make sure that the usage_key is defined # (since that's currently typed in). If the corresponding module descriptor doesn't exist, @@ -279,13 +236,6 @@ def submit_delete_entrance_exam_state_for_student(request, usage_key, student): ItemNotFoundError is raised if entrance exam does not exists for given usage_key, AlreadyRunningError is raised if the entrance exam is already being reset. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # check arguments: make sure entrance exam(section) exists for given usage_key modulestore().get_item(usage_key) @@ -313,13 +263,6 @@ def submit_bulk_course_email(request, course_key, email_id): AlreadyRunningError is raised if the same recipients are already being emailed with the same CourseEmail object. - - This method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # Assume that the course is defined, and that the user has already been verified to have # appropriate access to the course. But make sure that the email exists. diff --git a/lms/djangoapps/instructor_task/api_helper.py b/lms/djangoapps/instructor_task/api_helper.py index 441703c851..c5bfbaa50d 100644 --- a/lms/djangoapps/instructor_task/api_helper.py +++ b/lms/djangoapps/instructor_task/api_helper.py @@ -9,6 +9,7 @@ import json import logging from django.utils.translation import ugettext as _ +from util.db import outer_atomic from celery.result import AsyncResult from celery.states import READY_STATES, SUCCESS, FAILURE, REVOKED @@ -48,13 +49,6 @@ def _reserve_task(course_id, task_type, task_key, task_input, requester): Includes the creation of an arbitrary value for task_id, to be submitted with the task call to celery. - The InstructorTask.create method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. - Note that there is a chance of a race condition here, when two users try to run the same task at almost exactly the same time. One user could be after the check and before the create when the second user @@ -327,20 +321,16 @@ def submit_task(request, task_type, task_class, course_key, task_input, task_key the `request` provided by the originating server request. Then the task is submitted to run asynchronously, using the specified `task_class` and using the task_id constructed for it. + Cannot be inside an atomic block. + `AlreadyRunningError` is raised if the task is already running. - - The _reserve_task method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. - """ - # check to see if task is already running, and reserve it otherwise: - instructor_task = _reserve_task(course_key, task_type, task_key, task_input, request.user) + with outer_atomic(): + # check to see if task is already running, and reserve it otherwise: + instructor_task = _reserve_task(course_key, task_type, task_key, task_input, request.user) + + # make sure all data has been committed before handing off task to celery. - # submit task: task_id = instructor_task.task_id task_args = [instructor_task.id, _get_xmodule_instance_args(request, task_id)] # pylint: disable=no-member task_class.apply_async(task_args, task_id=task_id) diff --git a/lms/djangoapps/instructor_task/migrations/0001_initial.py b/lms/djangoapps/instructor_task/migrations/0001_initial.py index add6f0b7f1..487f5a7408 100644 --- a/lms/djangoapps/instructor_task/migrations/0001_initial.py +++ b/lms/djangoapps/instructor_task/migrations/0001_initial.py @@ -1,86 +1,33 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'InstructorTask' - db.create_table('instructor_task_instructortask', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('task_type', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('task_key', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('task_input', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('task_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('task_state', self.gf('django.db.models.fields.CharField')(max_length=50, null=True, db_index=True)), - ('task_output', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True)), - ('requester', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)), - ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('instructor_task', ['InstructorTask']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'InstructorTask' - db.delete_table('instructor_task_instructortask') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'instructor_task.instructortask': { - 'Meta': {'object_name': 'InstructorTask'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'requester': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'task_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'task_input': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'task_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'task_output': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}), - 'task_state': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}), - 'task_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['instructor_task'] + operations = [ + migrations.CreateModel( + name='InstructorTask', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('task_type', models.CharField(max_length=50, db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('task_key', models.CharField(max_length=255, db_index=True)), + ('task_input', models.CharField(max_length=255)), + ('task_id', models.CharField(max_length=255, db_index=True)), + ('task_state', models.CharField(max_length=50, null=True, db_index=True)), + ('task_output', models.CharField(max_length=1024, null=True)), + ('created', models.DateTimeField(auto_now_add=True, null=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('subtasks', models.TextField(blank=True)), + ('requester', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py b/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py deleted file mode 100644 index 81e55c6e16..0000000000 --- a/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'InstructorTask.subtasks' - db.add_column('instructor_task_instructortask', 'subtasks', - self.gf('django.db.models.fields.TextField')(default='', blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'InstructorTask.subtasks' - db.delete_column('instructor_task_instructortask', 'subtasks') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'instructor_task.instructortask': { - 'Meta': {'object_name': 'InstructorTask'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'requester': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'subtasks': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'task_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'task_input': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'task_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'task_output': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}), - 'task_state': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}), - 'task_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['instructor_task'] diff --git a/lms/djangoapps/instructor_task/models.py b/lms/djangoapps/instructor_task/models.py index 80450eb22e..ebc9af8f0c 100644 --- a/lms/djangoapps/instructor_task/models.py +++ b/lms/djangoapps/instructor_task/models.py @@ -87,13 +87,6 @@ class InstructorTask(models.Model): def create(cls, course_id, task_type, task_key, task_input, requester): """ Create an instance of InstructorTask. - - The InstructorTask.save_now method makes sure the InstructorTask entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, an autocommit buried within here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ # create the task_id here, and pass it into celery: task_id = str(uuid4()) @@ -120,17 +113,10 @@ class InstructorTask(models.Model): return instructor_task - @transaction.autocommit + @transaction.atomic def save_now(self): """ Writes InstructorTask immediately, ensuring the transaction is committed. - - Autocommit annotation makes sure the database entry is committed. - When called from any view that is wrapped by TransactionMiddleware, - and thus in a "commit-on-success" transaction, this autocommit here - will cause any pending transaction to be committed by a successful - save here. Any future database operations will take place in a - separate transaction. """ self.save() diff --git a/lms/djangoapps/instructor_task/subtasks.py b/lms/djangoapps/instructor_task/subtasks.py index 2cafad3a77..3fb89f3621 100644 --- a/lms/djangoapps/instructor_task/subtasks.py +++ b/lms/djangoapps/instructor_task/subtasks.py @@ -15,6 +15,7 @@ from django.db import transaction, DatabaseError from django.core.cache import cache from instructor_task.models import InstructorTask, PROGRESS, QUEUING +from util.db import outer_atomic TASK_LOG = logging.getLogger('edx.celery.task') @@ -317,7 +318,9 @@ def queue_subtasks_for_query( total_num_subtasks, total_num_items, ) - progress = initialize_subtask_info(entry, action_name, total_num_items, subtask_id_list) + # Make sure this is committed to database before handing off subtasks to celery. + with outer_atomic(): + progress = initialize_subtask_info(entry, action_name, total_num_items, subtask_id_list) # Construct a generator that will return the recipients to use for each subtask. # Pass in the desired fields to fetch for each recipient. @@ -494,7 +497,7 @@ def update_subtask_status(entry_id, current_task_id, new_subtask_status, retry_c _release_subtask_lock(current_task_id) -@transaction.commit_manually +@transaction.atomic def _update_subtask_status(entry_id, current_task_id, new_subtask_status): """ Update the status of the subtask in the parent InstructorTask object tracking its progress. @@ -582,9 +585,5 @@ def _update_subtask_status(entry_id, current_task_id, new_subtask_status): entry.task_output, current_task_id, entry_id) except Exception: TASK_LOG.exception("Unexpected error while updating InstructorTask.") - transaction.rollback() dog_stats_api.increment('instructor_task.subtask.update_exception') raise - else: - TASK_LOG.debug("about to commit....") - transaction.commit() diff --git a/lms/djangoapps/instructor_task/tasks_helper.py b/lms/djangoapps/instructor_task/tasks_helper.py index fa625cd739..073f1a5357 100644 --- a/lms/djangoapps/instructor_task/tasks_helper.py +++ b/lms/djangoapps/instructor_task/tasks_helper.py @@ -32,6 +32,7 @@ from shoppingcart.models import ( from survey.models import SurveyAnswer from track.views import task_track +from util.db import outer_atomic from util.file import course_filename_prefix_generator, UniversalNewlineIterator from xblock.runtime import KvsFieldData from xmodule.modulestore.django import modulestore @@ -64,8 +65,8 @@ from openedx.core.djangoapps.content.course_structures.models import CourseStruc from opaque_keys.edx.keys import UsageKey from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort, is_course_cohorted from student.models import CourseEnrollment, CourseAccessRole -from teams.models import CourseTeamMembership -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.teams.models import CourseTeamMembership +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification # define different loggers for use within tasks and on client side TASK_LOG = logging.getLogger('edx.celery.task') @@ -260,9 +261,10 @@ def run_main_task(entry_id, task_fcn, action_name): # Get the InstructorTask to be updated. If this fails then let the exception return to Celery. # There's no point in catching it here. - entry = InstructorTask.objects.get(pk=entry_id) - entry.task_state = PROGRESS - entry.save_now() + with outer_atomic(): + entry = InstructorTask.objects.get(pk=entry_id) + entry.task_state = PROGRESS + entry.save_now() # Get inputs to use in this task from the entry task_id = entry.task_id @@ -466,7 +468,7 @@ def _get_module_instance_for_task(course_id, student, module_descriptor, xmodule ) -@transaction.autocommit +@outer_atomic def rescore_problem_module_state(xmodule_instance_args, module_descriptor, student_module): ''' Takes an XModule descriptor and a corresponding StudentModule object, and @@ -555,7 +557,7 @@ def rescore_problem_module_state(xmodule_instance_args, module_descriptor, stude return UPDATE_STATUS_SUCCEEDED -@transaction.autocommit +@outer_atomic def reset_attempts_module_state(xmodule_instance_args, _module_descriptor, student_module): """ Resets problem attempts to zero for specified `student_module`. @@ -582,7 +584,7 @@ def reset_attempts_module_state(xmodule_instance_args, _module_descriptor, stude return update_status -@transaction.autocommit +@outer_atomic def delete_problem_module_state(xmodule_instance_args, _module_descriptor, student_module): """ Delete the StudentModule entry. @@ -1502,7 +1504,8 @@ def cohort_students_and_upload(_xmodule_instance_args, _entry_id, course_id, tas continue try: - add_user_to_cohort(cohorts_status[cohort_name]['cohort'], username_or_email) + with outer_atomic(): + add_user_to_cohort(cohorts_status[cohort_name]['cohort'], username_or_email) cohorts_status[cohort_name]['Students Added'] += 1 task_progress.succeeded += 1 except User.DoesNotExist: diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index 4e7d87e19a..4561c7e6b7 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -29,7 +29,7 @@ from shoppingcart.models import Order, PaidCourseRegistration, CourseRegistratio CourseRegistrationCodeInvoiceItem, InvoiceTransaction, Coupon from student.tests.factories import UserFactory, CourseModeFactory from student.models import CourseEnrollment, CourseEnrollmentAllowed, ManualEnrollmentAudit, ALLOWEDTOENROLL_TO_ENROLLED -from verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory +from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.partitions.partitions import Group, UserPartition from instructor_task.models import ReportStore @@ -1614,7 +1614,7 @@ class TestCertificateGeneration(InstructorTaskModuleTestCase): current_task.update_state = Mock() instructor_task = Mock() instructor_task.task_input = json.dumps({'students': None}) - with self.assertNumQueries(125): + with self.assertNumQueries(213): with patch('instructor_task.tasks_helper._get_current_task') as mock_current_task: mock_current_task.return_value = current_task with patch('capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_queue: diff --git a/lms/djangoapps/licenses/migrations/0001_initial.py b/lms/djangoapps/licenses/migrations/0001_initial.py index 365046272d..a7a26b6926 100644 --- a/lms/djangoapps/licenses/migrations/0001_initial.py +++ b/lms/djangoapps/licenses/migrations/0001_initial.py @@ -1,118 +1,35 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseSoftware' - db.create_table('licenses_coursesoftware', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('full_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('url', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal('licenses', ['CourseSoftware']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'UserLicense' - db.create_table('licenses_userlicense', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('software', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['licenses.CourseSoftware'])), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), - ('serial', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal('licenses', ['UserLicense']) - - - def backwards(self, orm): - # Deleting model 'CourseSoftware' - db.delete_table('licenses_coursesoftware') - - # Deleting model 'UserLicense' - db.delete_table('licenses_userlicense') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), - 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), - 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), - 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), - 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), - 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), - 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'licenses.coursesoftware': { - 'Meta': {'object_name': 'CourseSoftware'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'licenses.userlicense': { - 'Meta': {'object_name': 'UserLicense'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'serial': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'software': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['licenses.CourseSoftware']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}) - } - } - - complete_apps = ['licenses'] + operations = [ + migrations.CreateModel( + name='CourseSoftware', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=255)), + ('full_name', models.CharField(max_length=255)), + ('url', models.CharField(max_length=255)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255)), + ], + ), + migrations.CreateModel( + name='UserLicense', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('serial', models.CharField(max_length=255)), + ('software', models.ForeignKey(to='licenses.CourseSoftware')), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)), + ], + ), + ] diff --git a/lms/djangoapps/licenses/models.py b/lms/djangoapps/licenses/models.py index 6ec2c22d98..675db4d143 100644 --- a/lms/djangoapps/licenses/models.py +++ b/lms/djangoapps/licenses/models.py @@ -68,7 +68,7 @@ def _create_license(user, software): try: # find one license that has not been assigned, locking the # table/rows with select_for_update to prevent race conditions - with transaction.commit_on_success(): + with transaction.atomic(): selected = UserLicense.objects.select_for_update() license = selected.filter(user__isnull=True, software=software)[0] license.user = user diff --git a/lms/djangoapps/licenses/views.py b/lms/djangoapps/licenses/views.py index 839c145df5..c30cebd915 100644 --- a/lms/djangoapps/licenses/views.py +++ b/lms/djangoapps/licenses/views.py @@ -87,4 +87,4 @@ def user_software_license(request): else: response = {'error': 'No serial number found'} - return HttpResponse(json.dumps(response), mimetype='application/json') + return HttpResponse(json.dumps(response), content_type='application/json') diff --git a/lms/djangoapps/lms_xblock/migrations/0001_initial.py b/lms/djangoapps/lms_xblock/migrations/0001_initial.py index f4cdb0c97d..b0959b6a6a 100644 --- a/lms/djangoapps/lms_xblock/migrations/0001_initial.py +++ b/lms/djangoapps/lms_xblock/migrations/0001_initial.py @@ -1,74 +1,30 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'XBlockAsidesConfig' - db.create_table('lms_xblock_xblockasidesconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('disabled_blocks', self.gf('django.db.models.fields.TextField')(default='about course_info static_tab')), - )) - db.send_create_signal('lms_xblock', ['XBlockAsidesConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'XBlockAsidesConfig' - db.delete_table('lms_xblock_xblockasidesconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lms_xblock.xblockasidesconfig': { - 'Meta': {'object_name': 'XBlockAsidesConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'disabled_blocks': ('django.db.models.fields.TextField', [], {'default': "'about course_info static_tab'"}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['lms_xblock'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='XBlockAsidesConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('disabled_blocks', models.TextField(default=b'about course_info static_tab', help_text=b'Space-separated list of XBlocks on which XBlockAsides should never render.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/lms/djangoapps/lms_xblock/mixin.py b/lms/djangoapps/lms_xblock/mixin.py index fefd9a7e01..ba07f8d081 100644 --- a/lms/djangoapps/lms_xblock/mixin.py +++ b/lms/djangoapps/lms_xblock/mixin.py @@ -1,7 +1,8 @@ """ Namespace that defines fields common to all blocks used in the LMS """ -from django.utils.translation import ugettext_noop as _ + +#from django.utils.translation import ugettext_noop as _ from lazy import lazy from xblock.fields import Boolean, Scope, String, XBlockMixin, Dict @@ -9,6 +10,10 @@ from xblock.validation import ValidationMessage from xmodule.modulestore.inheritance import UserPartitionList from xmodule.partitions.partitions import NoSuchUserPartitionError, NoSuchUserPartitionGroupError +# Please do not remove, this is a workaround for Django 1.8. +# more information can be found here: https://openedx.atlassian.net/browse/PLAT-902 +_ = lambda text: text + class GroupAccessDict(Dict): """Special Dict class for serializing the group_access field""" diff --git a/lms/djangoapps/lms_xblock/models.py b/lms/djangoapps/lms_xblock/models.py index bffe8ebf27..a67878be48 100644 --- a/lms/djangoapps/lms_xblock/models.py +++ b/lms/djangoapps/lms_xblock/models.py @@ -18,6 +18,9 @@ class XBlockAsidesConfig(ConfigurationModel): Configuration for XBlockAsides. """ + class Meta(ConfigurationModel.Meta): + app_label = "lms_xblock" + disabled_blocks = TextField( default="about course_info static_tab", help_text="Space-separated list of XBlocks on which XBlockAsides should never render." diff --git a/lms/djangoapps/lti_provider/__init__.py b/lms/djangoapps/lti_provider/__init__.py index c95c036a80..ccf384160d 100644 --- a/lms/djangoapps/lti_provider/__init__.py +++ b/lms/djangoapps/lti_provider/__init__.py @@ -4,6 +4,3 @@ platform. LTI is a standard protocol for connecting educational tools, defined by IMS: http://www.imsglobal.org/toolsinteroperability2.cfm """ - -# Import the tasks module to ensure that signal handlers are registered. -import lms.djangoapps.lti_provider.tasks diff --git a/lms/djangoapps/lti_provider/migrations/0001_create_lti_consumer_model.py b/lms/djangoapps/lti_provider/migrations/0001_create_lti_consumer_model.py deleted file mode 100644 index c3d313afaa..0000000000 --- a/lms/djangoapps/lti_provider/migrations/0001_create_lti_consumer_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LtiConsumer' - db.create_table('lti_provider_lticonsumer', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('consumer_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('consumer_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32, db_index=True)), - ('consumer_secret', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32)), - )) - db.send_create_signal('lti_provider', ['LtiConsumer']) - - - def backwards(self, orm): - # Deleting model 'LtiConsumer' - db.delete_table('lti_provider_lticonsumer') - - - models = { - 'lti_provider.lticonsumer': { - 'Meta': {'object_name': 'LtiConsumer'}, - 'consumer_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'consumer_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'consumer_secret': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['lti_provider'] diff --git a/lms/djangoapps/lti_provider/migrations/0001_initial.py b/lms/djangoapps/lti_provider/migrations/0001_initial.py new file mode 100644 index 0000000000..575608c946 --- /dev/null +++ b/lms/djangoapps/lti_provider/migrations/0001_initial.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import provider.utils +from django.conf import settings +import xmodule_django.models + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='GradedAssignment', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('usage_key', xmodule_django.models.UsageKeyField(max_length=255, db_index=True)), + ('lis_result_sourcedid', models.CharField(max_length=255, db_index=True)), + ('version_number', models.IntegerField(default=0)), + ], + ), + migrations.CreateModel( + name='LtiConsumer', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('consumer_name', models.CharField(unique=True, max_length=255)), + ('consumer_key', models.CharField(default=provider.utils.short_token, unique=True, max_length=32, db_index=True)), + ('consumer_secret', models.CharField(default=provider.utils.long_token, unique=True, max_length=32)), + ('instance_guid', models.CharField(max_length=255, unique=True, null=True, blank=True)), + ], + ), + migrations.CreateModel( + name='LtiUser', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('lti_user_id', models.CharField(max_length=255)), + ('edx_user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), + ('lti_consumer', models.ForeignKey(to='lti_provider.LtiConsumer')), + ], + ), + migrations.CreateModel( + name='OutcomeService', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('lis_outcome_service_url', models.CharField(unique=True, max_length=255)), + ('lti_consumer', models.ForeignKey(to='lti_provider.LtiConsumer')), + ], + ), + migrations.AddField( + model_name='gradedassignment', + name='outcome_service', + field=models.ForeignKey(to='lti_provider.OutcomeService'), + ), + migrations.AddField( + model_name='gradedassignment', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='ltiuser', + unique_together=set([('lti_consumer', 'lti_user_id')]), + ), + migrations.AlterUniqueTogether( + name='gradedassignment', + unique_together=set([('outcome_service', 'lis_result_sourcedid')]), + ), + ] diff --git a/lms/djangoapps/lti_provider/migrations/0002_create_lti_outcome_management.py b/lms/djangoapps/lti_provider/migrations/0002_create_lti_outcome_management.py deleted file mode 100644 index 7728d2dd6e..0000000000 --- a/lms/djangoapps/lti_provider/migrations/0002_create_lti_outcome_management.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'OutcomeService' - db.create_table('lti_provider_outcomeservice', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('lis_outcome_service_url', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('lti_consumer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['lti_provider.LtiConsumer'])), - )) - db.send_create_signal('lti_provider', ['OutcomeService']) - - # Adding model 'GradedAssignment' - db.create_table('lti_provider_gradedassignment', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('usage_key', self.gf('xmodule_django.models.UsageKeyField')(max_length=255, db_index=True)), - ('outcome_service', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['lti_provider.OutcomeService'])), - ('lis_result_sourcedid', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - )) - db.send_create_signal('lti_provider', ['GradedAssignment']) - - # Adding unique constraint on 'GradedAssignment', fields ['outcome_service', 'lis_result_sourcedid'] - db.create_unique('lti_provider_gradedassignment', ['outcome_service_id', 'lis_result_sourcedid']) - - # Adding field 'LtiConsumer.instance_guid' - db.add_column('lti_provider_lticonsumer', 'instance_guid', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding unique constraint on 'LtiConsumer', fields ['consumer_name'] - db.create_unique('lti_provider_lticonsumer', ['consumer_name']) - - - def backwards(self, orm): - # Removing unique constraint on 'LtiConsumer', fields ['consumer_name'] - db.delete_unique('lti_provider_lticonsumer', ['consumer_name']) - - # Removing unique constraint on 'GradedAssignment', fields ['outcome_service', 'lis_result_sourcedid'] - db.delete_unique('lti_provider_gradedassignment', ['outcome_service_id', 'lis_result_sourcedid']) - - # Deleting model 'OutcomeService' - db.delete_table('lti_provider_outcomeservice') - - # Deleting model 'GradedAssignment' - db.delete_table('lti_provider_gradedassignment') - - # Deleting field 'LtiConsumer.instance_guid' - db.delete_column('lti_provider_lticonsumer', 'instance_guid') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lti_provider.gradedassignment': { - 'Meta': {'unique_together': "(('outcome_service', 'lis_result_sourcedid'),)", 'object_name': 'GradedAssignment'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_result_sourcedid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'outcome_service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.OutcomeService']"}), - 'usage_key': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'lti_provider.lticonsumer': { - 'Meta': {'object_name': 'LtiConsumer'}, - 'consumer_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'consumer_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'consumer_secret': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'instance_guid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) - }, - 'lti_provider.outcomeservice': { - 'Meta': {'object_name': 'OutcomeService'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_outcome_service_url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'lti_consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.LtiConsumer']"}) - } - } - - complete_apps = ['lti_provider'] diff --git a/lms/djangoapps/lti_provider/migrations/0003_create_lti_user_model.py b/lms/djangoapps/lti_provider/migrations/0003_create_lti_user_model.py deleted file mode 100644 index 22caf03f6f..0000000000 --- a/lms/djangoapps/lti_provider/migrations/0003_create_lti_user_model.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LtiUser' - db.create_table('lti_provider_ltiuser', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('lti_consumer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['lti_provider.LtiConsumer'])), - ('lti_user_id', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('edx_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)), - )) - db.send_create_signal('lti_provider', ['LtiUser']) - - # Adding unique constraint on 'LtiUser', fields ['lti_consumer', 'lti_user_id'] - db.create_unique('lti_provider_ltiuser', ['lti_consumer_id', 'lti_user_id']) - - # Adding unique constraint on 'LtiConsumer', fields ['instance_guid'] - db.create_unique('lti_provider_lticonsumer', ['instance_guid']) - - - def backwards(self, orm): - # Removing unique constraint on 'LtiConsumer', fields ['instance_guid'] - db.delete_unique('lti_provider_lticonsumer', ['instance_guid']) - - # Removing unique constraint on 'LtiUser', fields ['lti_consumer', 'lti_user_id'] - db.delete_unique('lti_provider_ltiuser', ['lti_consumer_id', 'lti_user_id']) - - # Deleting model 'LtiUser' - db.delete_table('lti_provider_ltiuser') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lti_provider.gradedassignment': { - 'Meta': {'unique_together': "(('outcome_service', 'lis_result_sourcedid'),)", 'object_name': 'GradedAssignment'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_result_sourcedid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'outcome_service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.OutcomeService']"}), - 'usage_key': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'lti_provider.lticonsumer': { - 'Meta': {'object_name': 'LtiConsumer'}, - 'consumer_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'consumer_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'consumer_secret': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'instance_guid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}) - }, - 'lti_provider.ltiuser': { - 'Meta': {'unique_together': "(('lti_consumer', 'lti_user_id'),)", 'object_name': 'LtiUser'}, - 'edx_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lti_consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.LtiConsumer']"}), - 'lti_user_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'lti_provider.outcomeservice': { - 'Meta': {'object_name': 'OutcomeService'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_outcome_service_url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'lti_consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.LtiConsumer']"}) - } - } - - complete_apps = ['lti_provider'] diff --git a/lms/djangoapps/lti_provider/migrations/0004_add_version_to_graded_assignment.py b/lms/djangoapps/lti_provider/migrations/0004_add_version_to_graded_assignment.py deleted file mode 100644 index ae232a7571..0000000000 --- a/lms/djangoapps/lti_provider/migrations/0004_add_version_to_graded_assignment.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'GradedAssignment.version_number' - db.add_column('lti_provider_gradedassignment', 'version_number', - self.gf('django.db.models.fields.IntegerField')(default=0), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'GradedAssignment.version_number' - db.delete_column('lti_provider_gradedassignment', 'version_number') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lti_provider.gradedassignment': { - 'Meta': {'unique_together': "(('outcome_service', 'lis_result_sourcedid'),)", 'object_name': 'GradedAssignment'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_result_sourcedid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'outcome_service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.OutcomeService']"}), - 'usage_key': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'version_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'lti_provider.lticonsumer': { - 'Meta': {'object_name': 'LtiConsumer'}, - 'consumer_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'consumer_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'consumer_secret': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'instance_guid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}) - }, - 'lti_provider.ltiuser': { - 'Meta': {'unique_together': "(('lti_consumer', 'lti_user_id'),)", 'object_name': 'LtiUser'}, - 'edx_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lti_consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.LtiConsumer']"}), - 'lti_user_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'lti_provider.outcomeservice': { - 'Meta': {'object_name': 'OutcomeService'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'lis_outcome_service_url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'lti_consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lti_provider.LtiConsumer']"}) - } - } - - complete_apps = ['lti_provider'] diff --git a/lms/djangoapps/lti_provider/models.py b/lms/djangoapps/lti_provider/models.py index 571b309e84..a42f686fb1 100644 --- a/lms/djangoapps/lti_provider/models.py +++ b/lms/djangoapps/lti_provider/models.py @@ -129,7 +129,7 @@ class LtiUser(models.Model): """ lti_consumer = models.ForeignKey(LtiConsumer) lti_user_id = models.CharField(max_length=255) - edx_user = models.ForeignKey(User, unique=True) + edx_user = models.OneToOneField(User) class Meta(object): unique_together = ('lti_consumer', 'lti_user_id') diff --git a/lms/djangoapps/lti_provider/startup.py b/lms/djangoapps/lti_provider/startup.py new file mode 100644 index 0000000000..ff27579134 --- /dev/null +++ b/lms/djangoapps/lti_provider/startup.py @@ -0,0 +1,4 @@ +"""Code run at server start up to initialize the lti_provider app.""" + +# Import the tasks module to ensure that signal handlers are registered. +import lms.djangoapps.lti_provider.tasks # pylint: disable=unused-import diff --git a/lms/djangoapps/lti_provider/tests/test_outcomes.py b/lms/djangoapps/lti_provider/tests/test_outcomes.py index e89e366d29..662e982d74 100644 --- a/lms/djangoapps/lti_provider/tests/test_outcomes.py +++ b/lms/djangoapps/lti_provider/tests/test_outcomes.py @@ -59,7 +59,7 @@ class StoreOutcomeParametersTest(TestCase): def test_graded_assignment_created(self): params = self.get_valid_request_params() - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) assignment = GradedAssignment.objects.get( lis_result_sourcedid=params['lis_result_sourcedid'] @@ -70,7 +70,7 @@ class StoreOutcomeParametersTest(TestCase): def test_outcome_service_created(self): params = self.get_valid_request_params() - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) outcome = OutcomeService.objects.get( lti_consumer=self.consumer @@ -79,7 +79,7 @@ class StoreOutcomeParametersTest(TestCase): def test_graded_assignment_references_outcome_service(self): params = self.get_valid_request_params() - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) outcome = OutcomeService.objects.get( lti_consumer=self.consumer @@ -91,7 +91,7 @@ class StoreOutcomeParametersTest(TestCase): def test_no_duplicate_graded_assignments(self): params = self.get_valid_request_params() - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) with self.assertNumQueries(2): outcomes.store_outcome_parameters(params, self.user, self.consumer) @@ -102,7 +102,7 @@ class StoreOutcomeParametersTest(TestCase): def test_no_duplicate_outcome_services(self): params = self.get_valid_request_params() - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) with self.assertNumQueries(2): outcomes.store_outcome_parameters(params, self.user, self.consumer) @@ -126,7 +126,7 @@ class StoreOutcomeParametersTest(TestCase): def test_db_record_created_without_consumer_id(self): params = self.get_valid_request_params() del params['tool_consumer_instance_guid'] - with self.assertNumQueries(4): + with self.assertNumQueries(8): outcomes.store_outcome_parameters(params, self.user, self.consumer) self.assertEqual(GradedAssignment.objects.count(), 1) self.assertEqual(OutcomeService.objects.count(), 1) diff --git a/lms/djangoapps/lti_provider/tests/test_views.py b/lms/djangoapps/lti_provider/tests/test_views.py index 6533f18a1a..5e8d899046 100644 --- a/lms/djangoapps/lti_provider/tests/test_views.py +++ b/lms/djangoapps/lti_provider/tests/test_views.py @@ -149,7 +149,7 @@ class LtiLaunchTest(LtiTestMixin, TestCase): SignatureValidator.verify = MagicMock(return_value=False) request = build_launch_request() request.POST.update(LTI_OPTIONAL_PARAMS) - with self.assertNumQueries(4): + with self.assertNumQueries(3): views.lti_launch(request, None, None) consumer = models.LtiConsumer.objects.get( consumer_key=LTI_DEFAULT_PARAMS['oauth_consumer_key'] diff --git a/lms/djangoapps/lti_provider/users.py b/lms/djangoapps/lti_provider/users.py index dadaf8d7cc..41ec1c8eb9 100644 --- a/lms/djangoapps/lti_provider/users.py +++ b/lms/djangoapps/lti_provider/users.py @@ -11,7 +11,7 @@ from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied -from django.db import IntegrityError +from django.db import IntegrityError, transaction from lti_provider.models import LtiUser from student.models import UserProfile @@ -53,16 +53,17 @@ def create_lti_user(lti_user_id, lti_consumer): try: edx_user_id = generate_random_edx_username() edx_email = "{}@{}".format(edx_user_id, settings.LTI_USER_EMAIL_DOMAIN) - edx_user = User.objects.create_user( - username=edx_user_id, - password=edx_password, - email=edx_email, - ) - # A profile is required if PREVENT_CONCURRENT_LOGINS flag is set. - # TODO: We could populate user information from the LTI launch here, - # but it's not necessary for our current uses. - edx_user_profile = UserProfile(user=edx_user) - edx_user_profile.save() + with transaction.atomic(): + edx_user = User.objects.create_user( + username=edx_user_id, + password=edx_password, + email=edx_email, + ) + # A profile is required if PREVENT_CONCURRENT_LOGINS flag is set. + # TODO: We could populate user information from the LTI launch here, + # but it's not necessary for our current uses. + edx_user_profile = UserProfile(user=edx_user) + edx_user_profile.save() created = True except IntegrityError: # The random edx_user_id wasn't unique. Since 'created' is still diff --git a/lms/djangoapps/mobile_api/migrations/0001_initial.py b/lms/djangoapps/mobile_api/migrations/0001_initial.py index 82a0ecc27e..e5bff1cbe0 100644 --- a/lms/djangoapps/mobile_api/migrations/0001_initial.py +++ b/lms/djangoapps/mobile_api/migrations/0001_initial.py @@ -1,78 +1,30 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'MobileApiConfig' - db.create_table('mobile_api_mobileapiconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('video_profiles', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('mobile_api', ['MobileApiConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - if not db.dry_run: - orm.MobileApiConfig.objects.create( - video_profiles="mobile_low,mobile_high,youtube", - ) - - def backwards(self, orm): - # Deleting model 'MobileApiConfig' - db.delete_table('mobile_api_mobileapiconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'mobile_api.mobileapiconfig': { - 'Meta': {'object_name': 'MobileApiConfig'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'video_profiles': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - } - } - - complete_apps = ['mobile_api'] + operations = [ + migrations.CreateModel( + name='MobileApiConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('video_profiles', models.TextField(help_text=b'A comma-separated list of names of profiles to include for videos returned from the mobile API.', blank=True)), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/lms/djangoapps/mobile_api/video_outlines/tests.py b/lms/djangoapps/mobile_api/video_outlines/tests.py index f25424155e..3e8f0a2f14 100644 --- a/lms/djangoapps/mobile_api/video_outlines/tests.py +++ b/lms/djangoapps/mobile_api/video_outlines/tests.py @@ -2,6 +2,7 @@ """ Tests for video outline API """ + import ddt import itertools from uuid import uuid4 diff --git a/lms/djangoapps/notes/migrations/0001_initial.py b/lms/djangoapps/notes/migrations/0001_initial.py index 6b0a071212..3d59e81075 100644 --- a/lms/djangoapps/notes/migrations/0001_initial.py +++ b/lms/djangoapps/notes/migrations/0001_initial.py @@ -1,90 +1,34 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'Note' - db.create_table('notes_note', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('uri', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('text', self.gf('django.db.models.fields.TextField')(default='')), - ('quote', self.gf('django.db.models.fields.TextField')(default='')), - ('range_start', self.gf('django.db.models.fields.CharField')(max_length=2048)), - ('range_start_offset', self.gf('django.db.models.fields.IntegerField')()), - ('range_end', self.gf('django.db.models.fields.CharField')(max_length=2048)), - ('range_end_offset', self.gf('django.db.models.fields.IntegerField')()), - ('tags', self.gf('django.db.models.fields.TextField')(default='')), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, db_index=True, blank=True)), - ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - )) - db.send_create_signal('notes', ['Note']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'Note' - db.delete_table('notes_note') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'notes.note': { - 'Meta': {'object_name': 'Note'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'quote': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'range_end': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'range_end_offset': ('django.db.models.fields.IntegerField', [], {}), - 'range_start': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), - 'range_start_offset': ('django.db.models.fields.IntegerField', [], {}), - 'tags': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'text': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'uri': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['notes'] + operations = [ + migrations.CreateModel( + name='Note', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('uri', models.CharField(max_length=255, db_index=True)), + ('text', models.TextField(default=b'')), + ('quote', models.TextField(default=b'')), + ('range_start', models.CharField(max_length=2048)), + ('range_start_offset', models.IntegerField()), + ('range_end', models.CharField(max_length=2048)), + ('range_end_offset', models.IntegerField()), + ('tags', models.TextField(default=b'')), + ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), + ('updated', models.DateTimeField(auto_now=True, db_index=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/lms/djangoapps/notes/models.py b/lms/djangoapps/notes/models.py index 2517316b58..23bd44e350 100644 --- a/lms/djangoapps/notes/models.py +++ b/lms/djangoapps/notes/models.py @@ -22,6 +22,9 @@ class Note(models.Model): created = models.DateTimeField(auto_now_add=True, null=True, db_index=True) updated = models.DateTimeField(auto_now=True, db_index=True) + class Meta: + app_label = 'notes' + def clean(self, json_body): """ Cleans the note object or raises a ValidationError. diff --git a/lms/djangoapps/open_ended_grading/staff_grading_service.py b/lms/djangoapps/open_ended_grading/staff_grading_service.py index 2a3ae6942a..80cecbf9f3 100644 --- a/lms/djangoapps/open_ended_grading/staff_grading_service.py +++ b/lms/djangoapps/open_ended_grading/staff_grading_service.py @@ -223,7 +223,7 @@ def _err_response(msg): Return a HttpResponse with a json dump with success=False, and the given error message. """ return HttpResponse(json.dumps({'success': False, 'error': msg}), - mimetype="application/json") + content_type="application/json") def _check_access(user, course_id): @@ -274,7 +274,7 @@ def get_next(request, course_id): location = course_key.make_usage_key_from_deprecated_string(p['location']) return HttpResponse(json.dumps(_get_next(course_key, grader_id, location)), - mimetype="application/json") + content_type="application/json") def get_problem_list(request, course_id): @@ -330,8 +330,7 @@ def get_problem_list(request, course_id): response['problem_list'] = valid_problem_list response = json.dumps(response) - return HttpResponse(response, - mimetype="application/json") + return HttpResponse(response, content_type="application/json") except GradingServiceError: #This is a dev_facing_error log.exception( @@ -432,7 +431,7 @@ def save_grade(request, course_id): # Ok, save_grade seemed to work. Get the next submission to grade. return HttpResponse(json.dumps(_get_next(course_id, grader_id, location)), - mimetype="application/json") + content_type="application/json") def check_feedback_length(data): diff --git a/lms/djangoapps/open_ended_grading/views.py b/lms/djangoapps/open_ended_grading/views.py index 81e7195e88..c17c00eebf 100644 --- a/lms/djangoapps/open_ended_grading/views.py +++ b/lms/djangoapps/open_ended_grading/views.py @@ -373,7 +373,7 @@ def take_action_on_flags(request, course_id): 'success': False, 'error': STAFF_ERROR_MESSAGE + error_message } - return HttpResponse(json.dumps(response), mimetype="application/json") + return HttpResponse(json.dumps(response), content_type="application/json") p = request.POST submission_id = p['submission_id'] @@ -387,7 +387,7 @@ def take_action_on_flags(request, course_id): controller_qs = create_controller_query_service() try: response = controller_qs.take_action_on_flags(course_key, student_id, submission_id, action_type) - return HttpResponse(json.dumps(response), mimetype="application/json") + return HttpResponse(json.dumps(response), content_type="application/json") except GradingServiceError: log.exception( u"Error taking action on flagged peer grading submissions, " @@ -398,4 +398,4 @@ def take_action_on_flags(request, course_id): 'success': False, 'error': STAFF_ERROR_MESSAGE } - return HttpResponse(json.dumps(response), mimetype="application/json") + return HttpResponse(json.dumps(response), content_type="application/json") diff --git a/lms/djangoapps/psychometrics/migrations/0001_initial.py b/lms/djangoapps/psychometrics/migrations/0001_initial.py new file mode 100644 index 0000000000..8cd81936d8 --- /dev/null +++ b/lms/djangoapps/psychometrics/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('courseware', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='PsychometricData', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('done', models.BooleanField(default=False)), + ('attempts', models.IntegerField(default=0)), + ('checktimes', models.TextField(null=True, blank=True)), + ('studentmodule', models.OneToOneField(to='courseware.StudentModule')), + ], + ), + ] diff --git a/lms/djangoapps/psychometrics/migrations/__init__.py b/lms/djangoapps/psychometrics/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lms/djangoapps/psychometrics/models.py b/lms/djangoapps/psychometrics/models.py index 4af5544c6c..e8070ca907 100644 --- a/lms/djangoapps/psychometrics/models.py +++ b/lms/djangoapps/psychometrics/models.py @@ -20,7 +20,10 @@ class PsychometricData(models.Model): checktimes is extracted from tracking logs, or added by capa module via psychometrics callback. """ - studentmodule = models.ForeignKey(StudentModule, db_index=True, unique=True) # contains student, module_state_key, course_id + class Meta(object): + app_label = "psychometrics" + + studentmodule = models.OneToOneField(StudentModule, db_index=True) # contains student, module_state_key, course_id done = models.BooleanField(default=False) attempts = models.IntegerField(default=0) # extracted from studentmodule.state diff --git a/lms/djangoapps/shoppingcart/admin.py b/lms/djangoapps/shoppingcart/admin.py index fae033a849..9385eef334 100644 --- a/lms/djangoapps/shoppingcart/admin.py +++ b/lms/djangoapps/shoppingcart/admin.py @@ -24,8 +24,8 @@ class SoftDeleteCouponAdmin(admin.ModelAdmin): """ Returns a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view. """ # Default: qs = self.model._default_manager.get_active_coupons_query_set() - # Queryset with all the coupons including the soft-deletes: qs = self.model._default_manager.get_query_set() - query_string = self.model._default_manager.get_active_coupons_query_set() # pylint: disable=protected-access + # Queryset with all the coupons including the soft-deletes: qs = self.model._default_manager.get_queryset() + query_string = self.model._default_manager.get_active_coupons_queryset() # pylint: disable=protected-access return query_string def get_actions(self, request): diff --git a/lms/djangoapps/shoppingcart/management/commands/retire_order.py b/lms/djangoapps/shoppingcart/management/commands/retire_order.py index 40932e0591..6ab3a63978 100644 --- a/lms/djangoapps/shoppingcart/management/commands/retire_order.py +++ b/lms/djangoapps/shoppingcart/management/commands/retire_order.py @@ -18,12 +18,13 @@ class Command(BaseCommand): Takes a file of orders to be retired, one order per line """ - def handle(self, *args, **options): - "Execute the command" - if len(args) != 1: - raise CommandError("retire_order requires one argument: ") + def add_arguments(self, parser): + parser.add_argument('file_name') - with open(args[0]) as orders_file: + def handle(self, *args, **options): + """Execute the command""" + + with open(options['file_name']) as orders_file: order_ids = [int(line.strip()) for line in orders_file.readlines()] orders = Order.objects.filter(id__in=order_ids) diff --git a/lms/djangoapps/shoppingcart/migrations/0001_initial.py b/lms/djangoapps/shoppingcart/migrations/0001_initial.py index 24ffeb1e59..dd2b48db7d 100644 --- a/lms/djangoapps/shoppingcart/migrations/0001_initial.py +++ b/lms/djangoapps/shoppingcart/migrations/0001_initial.py @@ -1,166 +1,289 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import django.db.models.deletion +from django.conf import settings +import model_utils.fields +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'Order' - db.create_table('shoppingcart_order', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('currency', self.gf('django.db.models.fields.CharField')(default='usd', max_length=8)), - ('status', self.gf('django.db.models.fields.CharField')(default='cart', max_length=32)), - ('purchase_time', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('bill_to_first', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('bill_to_last', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('bill_to_street1', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('bill_to_street2', self.gf('django.db.models.fields.CharField')(max_length=128, blank=True)), - ('bill_to_city', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('bill_to_state', self.gf('django.db.models.fields.CharField')(max_length=8, blank=True)), - ('bill_to_postalcode', self.gf('django.db.models.fields.CharField')(max_length=16, blank=True)), - ('bill_to_country', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)), - ('bill_to_ccnum', self.gf('django.db.models.fields.CharField')(max_length=8, blank=True)), - ('bill_to_cardtype', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)), - ('processor_reply_dump', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('shoppingcart', ['Order']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('student', '0001_initial'), + ] - # Adding model 'OrderItem' - db.create_table('shoppingcart_orderitem', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('order', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Order'])), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('status', self.gf('django.db.models.fields.CharField')(default='cart', max_length=32)), - ('qty', self.gf('django.db.models.fields.IntegerField')(default=1)), - ('unit_cost', self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2)), - ('line_cost', self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2)), - ('line_desc', self.gf('django.db.models.fields.CharField')(default='Misc. Item', max_length=1024)), - ('currency', self.gf('django.db.models.fields.CharField')(default='usd', max_length=8)), - )) - db.send_create_signal('shoppingcart', ['OrderItem']) - - # Adding model 'PaidCourseRegistration' - db.create_table('shoppingcart_paidcourseregistration', ( - ('orderitem_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['shoppingcart.OrderItem'], unique=True, primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), - )) - db.send_create_signal('shoppingcart', ['PaidCourseRegistration']) - - # Adding model 'CertificateItem' - db.create_table('shoppingcart_certificateitem', ( - ('orderitem_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['shoppingcart.OrderItem'], unique=True, primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), - ('course_enrollment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['student.CourseEnrollment'])), - ('mode', self.gf('django.db.models.fields.SlugField')(max_length=50)), - )) - db.send_create_signal('shoppingcart', ['CertificateItem']) - - def backwards(self, orm): - # Deleting model 'Order' - db.delete_table('shoppingcart_order') - - # Deleting model 'OrderItem' - db.delete_table('shoppingcart_orderitem') - - # Deleting model 'PaidCourseRegistration' - db.delete_table('shoppingcart_paidcourseregistration') - - # Deleting model 'CertificateItem' - db.delete_table('shoppingcart_certificateitem') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] + operations = [ + migrations.CreateModel( + name='Coupon', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('code', models.CharField(max_length=32, db_index=True)), + ('description', models.CharField(max_length=255, null=True, blank=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255)), + ('percentage_discount', models.IntegerField(default=0)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('is_active', models.BooleanField(default=True)), + ('expiration_date', models.DateTimeField(null=True, blank=True)), + ('created_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='CouponRedemption', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('coupon', models.ForeignKey(to='shoppingcart.Coupon')), + ], + ), + migrations.CreateModel( + name='CourseRegCodeItemAnnotation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=128, db_index=True)), + ('annotation', models.TextField(null=True)), + ], + ), + migrations.CreateModel( + name='CourseRegistrationCode', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('code', models.CharField(unique=True, max_length=32, db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('mode_slug', models.CharField(max_length=100, null=True)), + ('is_valid', models.BooleanField(default=True)), + ('created_by', models.ForeignKey(related_name='created_by_user', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='DonationConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='Invoice', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('company_name', models.CharField(max_length=255, db_index=True)), + ('company_contact_name', models.CharField(max_length=255)), + ('company_contact_email', models.CharField(max_length=255)), + ('recipient_name', models.CharField(max_length=255)), + ('recipient_email', models.CharField(max_length=255)), + ('address_line_1', models.CharField(max_length=255)), + ('address_line_2', models.CharField(max_length=255, null=True, blank=True)), + ('address_line_3', models.CharField(max_length=255, null=True, blank=True)), + ('city', models.CharField(max_length=255, null=True)), + ('state', models.CharField(max_length=255, null=True)), + ('zip', models.CharField(max_length=15, null=True)), + ('country', models.CharField(max_length=64, null=True)), + ('total_amount', models.FloatField()), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('internal_reference', models.CharField(help_text='Internal reference code for this invoice.', max_length=255, null=True, blank=True)), + ('customer_reference_number', models.CharField(help_text="Customer's reference code for this invoice.", max_length=63, null=True, blank=True)), + ('is_valid', models.BooleanField(default=True)), + ], + ), + migrations.CreateModel( + name='InvoiceHistory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)), + ('snapshot', models.TextField(blank=True)), + ('invoice', models.ForeignKey(to='shoppingcart.Invoice')), + ], + options={ + 'get_latest_by': 'timestamp', + }, + ), + migrations.CreateModel( + name='InvoiceItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('qty', models.IntegerField(default=1, help_text='The number of items sold.')), + ('unit_price', models.DecimalField(default=0.0, help_text='The price per item sold, including discounts.', max_digits=30, decimal_places=2)), + ('currency', models.CharField(default=b'usd', help_text='Lower-case ISO currency codes', max_length=8)), + ], + ), + migrations.CreateModel( + name='InvoiceTransaction', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('amount', models.DecimalField(default=0.0, help_text='The amount of the transaction. Use positive amounts for payments and negative amounts for refunds.', max_digits=30, decimal_places=2)), + ('currency', models.CharField(default=b'usd', help_text='Lower-case ISO currency codes', max_length=8)), + ('comments', models.TextField(help_text='Optional: provide additional information for this transaction', null=True, blank=True)), + ('status', models.CharField(default=b'started', help_text="The status of the payment or refund. 'started' means that payment is expected, but money has not yet been transferred. 'completed' means that the payment or refund was received. 'cancelled' means that payment or refund was expected, but was cancelled before money was transferred. ", max_length=32, choices=[(b'started', b'started'), (b'completed', b'completed'), (b'cancelled', b'cancelled')])), + ('created_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ('invoice', models.ForeignKey(to='shoppingcart.Invoice')), + ('last_modified_by', models.ForeignKey(related_name='last_modified_by_user', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('currency', models.CharField(default=b'usd', max_length=8)), + ('status', models.CharField(default=b'cart', max_length=32, choices=[(b'cart', b'cart'), (b'paying', b'paying'), (b'purchased', b'purchased'), (b'refunded', b'refunded'), (b'defunct-cart', b'defunct-cart'), (b'defunct-paying', b'defunct-paying')])), + ('purchase_time', models.DateTimeField(null=True, blank=True)), + ('refunded_time', models.DateTimeField(null=True, blank=True)), + ('bill_to_first', models.CharField(max_length=64, blank=True)), + ('bill_to_last', models.CharField(max_length=64, blank=True)), + ('bill_to_street1', models.CharField(max_length=128, blank=True)), + ('bill_to_street2', models.CharField(max_length=128, blank=True)), + ('bill_to_city', models.CharField(max_length=64, blank=True)), + ('bill_to_state', models.CharField(max_length=8, blank=True)), + ('bill_to_postalcode', models.CharField(max_length=16, blank=True)), + ('bill_to_country', models.CharField(max_length=64, blank=True)), + ('bill_to_ccnum', models.CharField(max_length=8, blank=True)), + ('bill_to_cardtype', models.CharField(max_length=32, blank=True)), + ('processor_reply_dump', models.TextField(blank=True)), + ('company_name', models.CharField(max_length=255, null=True, blank=True)), + ('company_contact_name', models.CharField(max_length=255, null=True, blank=True)), + ('company_contact_email', models.CharField(max_length=255, null=True, blank=True)), + ('recipient_name', models.CharField(max_length=255, null=True, blank=True)), + ('recipient_email', models.CharField(max_length=255, null=True, blank=True)), + ('customer_reference_number', models.CharField(max_length=63, null=True, blank=True)), + ('order_type', models.CharField(default=b'personal', max_length=32, choices=[(b'personal', b'personal'), (b'business', b'business')])), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='OrderItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('status', models.CharField(default=b'cart', max_length=32, db_index=True, choices=[(b'cart', b'cart'), (b'paying', b'paying'), (b'purchased', b'purchased'), (b'refunded', b'refunded'), (b'defunct-cart', b'defunct-cart'), (b'defunct-paying', b'defunct-paying')])), + ('qty', models.IntegerField(default=1)), + ('unit_cost', models.DecimalField(default=0.0, max_digits=30, decimal_places=2)), + ('list_price', models.DecimalField(null=True, max_digits=30, decimal_places=2)), + ('line_desc', models.CharField(default=b'Misc. Item', max_length=1024)), + ('currency', models.CharField(default=b'usd', max_length=8)), + ('fulfilled_time', models.DateTimeField(null=True, db_index=True)), + ('refund_requested_time', models.DateTimeField(null=True, db_index=True)), + ('service_fee', models.DecimalField(default=0.0, max_digits=30, decimal_places=2)), + ('report_comments', models.TextField(default=b'')), + ], + ), + migrations.CreateModel( + name='PaidCourseRegistrationAnnotation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=128, db_index=True)), + ('annotation', models.TextField(null=True)), + ], + ), + migrations.CreateModel( + name='RegistrationCodeRedemption', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('redeemed_at', models.DateTimeField(auto_now_add=True, null=True)), + ('course_enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)), + ('order', models.ForeignKey(to='shoppingcart.Order', null=True)), + ('redeemed_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ('registration_code', models.ForeignKey(to='shoppingcart.CourseRegistrationCode')), + ], + ), + migrations.CreateModel( + name='CertificateItem', + fields=[ + ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), + ('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), + ('mode', models.SlugField()), + ('course_enrollment', models.ForeignKey(to='student.CourseEnrollment')), + ], + bases=('shoppingcart.orderitem',), + ), + migrations.CreateModel( + name='CourseRegCodeItem', + fields=[ + ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), + ('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), + ('mode', models.SlugField(default=b'honor')), + ], + bases=('shoppingcart.orderitem',), + ), + migrations.CreateModel( + name='CourseRegistrationCodeInvoiceItem', + fields=[ + ('invoiceitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.InvoiceItem')), + ('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), + ], + bases=('shoppingcart.invoiceitem',), + ), + migrations.CreateModel( + name='Donation', + fields=[ + ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), + ('donation_type', models.CharField(default=b'general', max_length=32, choices=[(b'general', b'A general donation'), (b'course', b'A donation to a particular course')])), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ], + bases=('shoppingcart.orderitem',), + ), + migrations.CreateModel( + name='PaidCourseRegistration', + fields=[ + ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), + ('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), + ('mode', models.SlugField(default=b'honor')), + ('course_enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)), + ], + bases=('shoppingcart.orderitem',), + ), + migrations.AddField( + model_name='orderitem', + name='order', + field=models.ForeignKey(to='shoppingcart.Order'), + ), + migrations.AddField( + model_name='orderitem', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='invoiceitem', + name='invoice', + field=models.ForeignKey(to='shoppingcart.Invoice'), + ), + migrations.AddField( + model_name='courseregistrationcode', + name='invoice', + field=models.ForeignKey(to='shoppingcart.Invoice', null=True), + ), + migrations.AddField( + model_name='courseregistrationcode', + name='order', + field=models.ForeignKey(related_name='purchase_order', to='shoppingcart.Order', null=True), + ), + migrations.AddField( + model_name='couponredemption', + name='order', + field=models.ForeignKey(to='shoppingcart.Order'), + ), + migrations.AddField( + model_name='couponredemption', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='courseregistrationcode', + name='invoice_item', + field=models.ForeignKey(to='shoppingcart.CourseRegistrationCodeInvoiceItem', null=True), + ), + ] diff --git a/lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py b/lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py deleted file mode 100644 index 97f46aee81..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py +++ /dev/null @@ -1,112 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'PaidCourseRegistration.mode' - db.add_column('shoppingcart_paidcourseregistration', 'mode', - self.gf('django.db.models.fields.SlugField')(default='honor', max_length=50), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'PaidCourseRegistration.mode' - db.delete_column('shoppingcart_paidcourseregistration', 'mode') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0003_auto__del_field_orderitem_line_cost.py b/lms/djangoapps/shoppingcart/migrations/0003_auto__del_field_orderitem_line_cost.py deleted file mode 100644 index 080a6f1af2..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0003_auto__del_field_orderitem_line_cost.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'OrderItem.line_cost' - db.delete_column('shoppingcart_orderitem', 'line_cost') - - def backwards(self, orm): - # Adding field 'OrderItem.line_cost' - db.add_column('shoppingcart_orderitem', 'line_cost', - self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2), - keep_default=False) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py b/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py deleted file mode 100644 index 4271a24840..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py +++ /dev/null @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'OrderItem.fulfilled_time' - db.add_column('shoppingcart_orderitem', 'fulfilled_time', - self.gf('django.db.models.fields.DateTimeField')(null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'OrderItem.fulfilled_time' - db.delete_column('shoppingcart_orderitem', 'fulfilled_time') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py b/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py deleted file mode 100644 index 1e92306140..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'PaidCourseRegistrationAnnotation' - db.create_table('shoppingcart_paidcourseregistrationannotation', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128, db_index=True)), - ('annotation', self.gf('django.db.models.fields.TextField')(null=True)), - )) - db.send_create_signal('shoppingcart', ['PaidCourseRegistrationAnnotation']) - - # Adding field 'OrderItem.report_comments' - db.add_column('shoppingcart_orderitem', 'report_comments', - self.gf('django.db.models.fields.TextField')(default=''), - keep_default=False) - - - def backwards(self, orm): - # Deleting model 'PaidCourseRegistrationAnnotation' - db.delete_table('shoppingcart_paidcourseregistrationannotation') - - # Deleting field 'OrderItem.report_comments' - db.delete_column('shoppingcart_orderitem', 'report_comments') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py b/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py deleted file mode 100644 index cd8ee5b198..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py +++ /dev/null @@ -1,131 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'Order.refunded_time' - db.add_column('shoppingcart_order', 'refunded_time', - self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), - keep_default=False) - - # Adding field 'OrderItem.refund_requested_time' - db.add_column('shoppingcart_orderitem', 'refund_requested_time', - self.gf('django.db.models.fields.DateTimeField')(null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Order.refunded_time' - db.delete_column('shoppingcart_order', 'refunded_time') - - # Deleting field 'OrderItem.refund_requested_time' - db.delete_column('shoppingcart_orderitem', 'refund_requested_time') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py b/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py deleted file mode 100644 index bc086c05c2..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'OrderItem.service_fee' - db.add_column('shoppingcart_orderitem', 'service_fee', - self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2), - keep_default=False) - - # Adding index on 'OrderItem', fields ['status'] - db.create_index('shoppingcart_orderitem', ['status']) - - # Adding index on 'OrderItem', fields ['fulfilled_time'] - db.create_index('shoppingcart_orderitem', ['fulfilled_time']) - - # Adding index on 'OrderItem', fields ['refund_requested_time'] - db.create_index('shoppingcart_orderitem', ['refund_requested_time']) - - - def backwards(self, orm): - # Removing index on 'OrderItem', fields ['refund_requested_time'] - db.delete_index('shoppingcart_orderitem', ['refund_requested_time']) - - # Removing index on 'OrderItem', fields ['fulfilled_time'] - db.delete_index('shoppingcart_orderitem', ['fulfilled_time']) - - # Removing index on 'OrderItem', fields ['status'] - db.delete_index('shoppingcart_orderitem', ['status']) - - # Deleting field 'OrderItem.service_fee' - db.delete_column('shoppingcart_orderitem', 'service_fee') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py b/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py deleted file mode 100644 index f64f20edd7..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py +++ /dev/null @@ -1,189 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Coupons' - db.create_table('shoppingcart_coupons', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)), - ('percentage_discount', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 24, 0, 0))), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), - )) - db.send_create_signal('shoppingcart', ['Coupons']) - - # Adding model 'CouponRedemption' - db.create_table('shoppingcart_couponredemption', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('order', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Order'])), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('coupon', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Coupons'])), - )) - db.send_create_signal('shoppingcart', ['CouponRedemption']) - - - # Changing field 'CertificateItem.course_id' - db.alter_column('shoppingcart_certificateitem', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=128)) - - # Changing field 'PaidCourseRegistrationAnnotation.course_id' - db.alter_column('shoppingcart_paidcourseregistrationannotation', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=128)) - - # Changing field 'PaidCourseRegistration.course_id' - db.alter_column('shoppingcart_paidcourseregistration', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=128)) - # Adding field 'OrderItem.discount_price' - db.add_column('shoppingcart_orderitem', 'discount_price', - self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=30, decimal_places=2), - keep_default=False) - - - def backwards(self, orm): - # Deleting model 'Coupons' - db.delete_table('shoppingcart_coupons') - - # Deleting model 'CouponRedemption' - db.delete_table('shoppingcart_couponredemption') - - - # Changing field 'CertificateItem.course_id' - db.alter_column('shoppingcart_certificateitem', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=128)) - - # Changing field 'PaidCourseRegistrationAnnotation.course_id' - db.alter_column('shoppingcart_paidcourseregistrationannotation', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=128, unique=True)) - - # Changing field 'PaidCourseRegistration.course_id' - db.alter_column('shoppingcart_paidcourseregistration', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=128)) - # Deleting field 'OrderItem.discount_price' - db.delete_column('shoppingcart_orderitem', 'discount_price') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupons']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.coupons': { - 'Meta': {'object_name': 'Coupons'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 6, 24, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'discount_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py b/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py deleted file mode 100644 index f17db05296..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py +++ /dev/null @@ -1,216 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting model 'Coupons' - db.delete_table('shoppingcart_coupons') - - # Adding model 'CourseRegistrationCode' - db.create_table('shoppingcart_courseregistrationcode', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('transaction_group_name', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, null=True, blank=True)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='created_by_user', to=orm['auth.User'])), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 1, 0, 0))), - ('redeemed_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='redeemed_by_user', null=True, to=orm['auth.User'])), - ('redeemed_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 1, 0, 0), null=True)), - )) - db.send_create_signal('shoppingcart', ['CourseRegistrationCode']) - - # Adding model 'Coupon' - db.create_table('shoppingcart_coupon', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)), - ('percentage_discount', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 1, 0, 0))), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), - )) - db.send_create_signal('shoppingcart', ['Coupon']) - - - # Changing field 'CouponRedemption.coupon' - db.alter_column('shoppingcart_couponredemption', 'coupon_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Coupon'])) - # Deleting field 'OrderItem.discount_price' - db.delete_column('shoppingcart_orderitem', 'discount_price') - - # Adding field 'OrderItem.list_price' - db.add_column('shoppingcart_orderitem', 'list_price', - self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=30, decimal_places=2), - keep_default=False) - - - def backwards(self, orm): - # Adding model 'Coupons' - db.create_table('shoppingcart_coupons', ( - ('code', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('percentage_discount', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 6, 24, 0, 0))), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - )) - db.send_create_signal('shoppingcart', ['Coupons']) - - # Deleting model 'CourseRegistrationCode' - db.delete_table('shoppingcart_courseregistrationcode') - - # Deleting model 'Coupon' - db.delete_table('shoppingcart_coupon') - - - # Changing field 'CouponRedemption.coupon' - db.alter_column('shoppingcart_couponredemption', 'coupon_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Coupons'])) - # Adding field 'OrderItem.discount_price' - db.add_column('shoppingcart_orderitem', 'discount_price', - self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=30, decimal_places=2), - keep_default=False) - - # Deleting field 'OrderItem.list_price' - db.delete_column('shoppingcart_orderitem', 'list_price') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 1, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 1, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 1, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'redeemed_by_user'", 'null': 'True', 'to': "orm['auth.User']"}), - 'transaction_group_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py b/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py deleted file mode 100644 index fd740f9fff..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'RegistrationCodeRedemption' - db.create_table('shoppingcart_registrationcoderedemption', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('order', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Order'])), - ('registration_code', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.CourseRegistrationCode'])), - ('redeemed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('redeemed_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 16, 0, 0), null=True)), - )) - db.send_create_signal('shoppingcart', ['RegistrationCodeRedemption']) - - # Deleting field 'CourseRegistrationCode.redeemed_by' - db.delete_column('shoppingcart_courseregistrationcode', 'redeemed_by_id') - - # Deleting field 'CourseRegistrationCode.redeemed_at' - db.delete_column('shoppingcart_courseregistrationcode', 'redeemed_at') - - # Adding unique constraint on 'CourseRegistrationCode', fields ['code'] - db.create_unique('shoppingcart_courseregistrationcode', ['code']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseRegistrationCode', fields ['code'] - db.delete_unique('shoppingcart_courseregistrationcode', ['code']) - - # Deleting model 'RegistrationCodeRedemption' - db.delete_table('shoppingcart_registrationcoderedemption') - - # Adding field 'CourseRegistrationCode.redeemed_by' - db.add_column('shoppingcart_courseregistrationcode', 'redeemed_by', - self.gf('django.db.models.fields.related.ForeignKey')(related_name='redeemed_by_user', null=True, to=orm['auth.User']), - keep_default=False) - - # Adding field 'CourseRegistrationCode.redeemed_at' - db.add_column('shoppingcart_courseregistrationcode', 'redeemed_at', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 1, 0, 0), null=True), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 16, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 16, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'transaction_group_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 7, 16, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py b/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py deleted file mode 100644 index 75ecf4b321..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py +++ /dev/null @@ -1,186 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Invoice' - db.create_table('shoppingcart_invoice', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('total_amount', self.gf('django.db.models.fields.FloatField')()), - ('purchaser_name', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('purchaser_contact', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('purchaser_email', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('tax_id', self.gf('django.db.models.fields.CharField')(max_length=64, null=True)), - ('reference', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)), - )) - db.send_create_signal('shoppingcart', ['Invoice']) - - # Adding field 'CourseRegistrationCode.invoice' - db.add_column('shoppingcart_courseregistrationcode', 'invoice', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Invoice'], null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting model 'Invoice' - db.delete_table('shoppingcart_invoice') - - # Deleting field 'CourseRegistrationCode.invoice' - db.delete_column('shoppingcart_courseregistrationcode', 'invoice_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'transaction_group_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'purchaser_contact': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'purchaser_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'purchaser_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'tax_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 6, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py b/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py deleted file mode 100644 index 0c5c72edd4..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py +++ /dev/null @@ -1,252 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CourseRegistrationCode.transaction_group_name' - db.delete_column('shoppingcart_courseregistrationcode', 'transaction_group_name') - - # Deleting field 'Invoice.purchaser_contact' - db.delete_column('shoppingcart_invoice', 'purchaser_contact') - - # Deleting field 'Invoice.purchaser_email' - db.delete_column('shoppingcart_invoice', 'purchaser_email') - - # Deleting field 'Invoice.reference' - db.delete_column('shoppingcart_invoice', 'reference') - - # Deleting field 'Invoice.purchaser_name' - db.delete_column('shoppingcart_invoice', 'purchaser_name') - - # Adding field 'Invoice.company_name' - db.add_column('shoppingcart_invoice', 'company_name', - self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True), - keep_default=False) - - # Adding field 'Invoice.course_id' - db.add_column('shoppingcart_invoice', 'course_id', - self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True), - keep_default=False) - - # Adding field 'Invoice.company_contact_name' - db.add_column('shoppingcart_invoice', 'company_contact_name', - self.gf('django.db.models.fields.CharField')(max_length=255), - keep_default=False) - - # Adding field 'Invoice.company_contact_email' - db.add_column('shoppingcart_invoice', 'company_contact_email', - self.gf('django.db.models.fields.CharField')(max_length=255), - keep_default=False) - - # Adding field 'Invoice.company_reference' - db.add_column('shoppingcart_invoice', 'company_reference', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.internal_reference' - db.add_column('shoppingcart_invoice', 'internal_reference', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'CourseRegistrationCode.transaction_group_name' - db.add_column('shoppingcart_courseregistrationcode', 'transaction_group_name', - self.gf('django.db.models.fields.CharField')(blank=True, max_length=255, null=True, db_index=True), - keep_default=False) - - # Adding field 'Invoice.purchaser_contact' - db.add_column('shoppingcart_invoice', 'purchaser_contact', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.purchaser_email' - db.add_column('shoppingcart_invoice', 'purchaser_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.reference' - db.add_column('shoppingcart_invoice', 'reference', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.purchaser_name' - db.add_column('shoppingcart_invoice', 'purchaser_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255, db_index=True), - keep_default=False) - - # Deleting field 'Invoice.company_name' - db.delete_column('shoppingcart_invoice', 'company_name') - - # Deleting field 'Invoice.course_id' - db.delete_column('shoppingcart_invoice', 'course_id') - - # Deleting field 'Invoice.company_contact_name' - db.delete_column('shoppingcart_invoice', 'company_contact_name') - - # Deleting field 'Invoice.company_contact_email' - db.delete_column('shoppingcart_invoice', 'company_contact_email') - - # Deleting field 'Invoice.company_reference' - db.delete_column('shoppingcart_invoice', 'company_reference') - - # Deleting field 'Invoice.internal_reference' - db.delete_column('shoppingcart_invoice', 'internal_reference') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 13, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 13, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'company_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'tax_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 13, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py b/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py deleted file mode 100644 index a898be5e75..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py +++ /dev/null @@ -1,173 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'Invoice.is_valid' - db.add_column('shoppingcart_invoice', 'is_valid', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Invoice.is_valid' - db.delete_column('shoppingcart_invoice', 'is_valid') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 20, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 20, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'company_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'tax_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 20, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py b/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py deleted file mode 100644 index 13ee149ff3..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py +++ /dev/null @@ -1,244 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'Invoice.tax_id' - db.delete_column('shoppingcart_invoice', 'tax_id') - - # Adding field 'Invoice.address_line_1' - db.add_column('shoppingcart_invoice', 'address_line_1', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.address_line_2' - db.add_column('shoppingcart_invoice', 'address_line_2', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.address_line_3' - db.add_column('shoppingcart_invoice', 'address_line_3', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.city' - db.add_column('shoppingcart_invoice', 'city', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.state' - db.add_column('shoppingcart_invoice', 'state', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Adding field 'Invoice.zip' - db.add_column('shoppingcart_invoice', 'zip', - self.gf('django.db.models.fields.CharField')(max_length=15, null=True), - keep_default=False) - - # Adding field 'Invoice.country' - db.add_column('shoppingcart_invoice', 'country', - self.gf('django.db.models.fields.CharField')(max_length=64, null=True), - keep_default=False) - - # Adding field 'Invoice.purchase_order_number' - db.add_column('shoppingcart_invoice', 'purchase_order_number', - self.gf('django.db.models.fields.CharField')(max_length=63, null=True), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'Invoice.tax_id' - db.add_column('shoppingcart_invoice', 'tax_id', - self.gf('django.db.models.fields.CharField')(max_length=64, null=True), - keep_default=False) - - # Deleting field 'Invoice.address_line_1' - db.delete_column('shoppingcart_invoice', 'address_line_1') - - # Deleting field 'Invoice.address_line_2' - db.delete_column('shoppingcart_invoice', 'address_line_2') - - # Deleting field 'Invoice.address_line_3' - db.delete_column('shoppingcart_invoice', 'address_line_3') - - # Deleting field 'Invoice.city' - db.delete_column('shoppingcart_invoice', 'city') - - # Deleting field 'Invoice.state' - db.delete_column('shoppingcart_invoice', 'state') - - # Deleting field 'Invoice.zip' - db.delete_column('shoppingcart_invoice', 'zip') - - # Deleting field 'Invoice.country' - db.delete_column('shoppingcart_invoice', 'country') - - # Deleting field 'Invoice.purchase_order_number' - db.delete_column('shoppingcart_invoice', 'purchase_order_number') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'company_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'purchase_order_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 27, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py b/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py deleted file mode 100644 index a934b1344b..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'Invoice.purchase_order_number' - db.delete_column('shoppingcart_invoice', 'purchase_order_number') - - # Deleting field 'Invoice.company_contact_name' - db.delete_column('shoppingcart_invoice', 'company_contact_name') - - # Deleting field 'Invoice.company_contact_email' - db.delete_column('shoppingcart_invoice', 'company_contact_email') - - # Adding field 'Invoice.company_email' - db.add_column('shoppingcart_invoice', 'company_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.recipient_name' - db.add_column('shoppingcart_invoice', 'recipient_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.recipient_email' - db.add_column('shoppingcart_invoice', 'recipient_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.customer_reference_number' - db.add_column('shoppingcart_invoice', 'customer_reference_number', - self.gf('django.db.models.fields.CharField')(max_length=63, null=True), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'Invoice.purchase_order_number' - db.add_column('shoppingcart_invoice', 'purchase_order_number', - self.gf('django.db.models.fields.CharField')(max_length=63, null=True), - keep_default=False) - - # Adding field 'Invoice.company_contact_name' - db.add_column('shoppingcart_invoice', 'company_contact_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.company_contact_email' - db.add_column('shoppingcart_invoice', 'company_contact_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Deleting field 'Invoice.company_email' - db.delete_column('shoppingcart_invoice', 'company_email') - - # Deleting field 'Invoice.recipient_name' - db.delete_column('shoppingcart_invoice', 'recipient_name') - - # Deleting field 'Invoice.recipient_email' - db.delete_column('shoppingcart_invoice', 'recipient_email') - - # Deleting field 'Invoice.customer_reference_number' - db.delete_column('shoppingcart_invoice', 'customer_reference_number') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 28, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 28, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'company_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 28, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py b/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py deleted file mode 100644 index f5baab13b6..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py +++ /dev/null @@ -1,205 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'Invoice.company_email' - db.delete_column('shoppingcart_invoice', 'company_email') - - # Deleting field 'Invoice.company_reference' - db.delete_column('shoppingcart_invoice', 'company_reference') - - # Adding field 'Invoice.company_contact_name' - db.add_column('shoppingcart_invoice', 'company_contact_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.company_contact_email' - db.add_column('shoppingcart_invoice', 'company_contact_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'Invoice.company_email' - db.add_column('shoppingcart_invoice', 'company_email', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding field 'Invoice.company_reference' - db.add_column('shoppingcart_invoice', 'company_reference', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True), - keep_default=False) - - # Deleting field 'Invoice.company_contact_name' - db.delete_column('shoppingcart_invoice', 'company_contact_name') - - # Deleting field 'Invoice.company_contact_email' - db.delete_column('shoppingcart_invoice', 'company_contact_email') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 29, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 29, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 29, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py b/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py deleted file mode 100644 index 5e6ae048cc..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py +++ /dev/null @@ -1,188 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseRegistrationCode.order' - db.add_column('shoppingcart_courseregistrationcode', 'order', - self.gf('django.db.models.fields.related.ForeignKey')(related_name='purchase_order', null=True, to=orm['shoppingcart.Order']), - keep_default=False) - - - # Changing field 'RegistrationCodeRedemption.order' - db.alter_column('shoppingcart_registrationcoderedemption', 'order_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Order'], null=True)) - - def backwards(self, orm): - # Deleting field 'CourseRegistrationCode.order' - db.delete_column('shoppingcart_courseregistrationcode', 'order_id') - - - # Changing field 'RegistrationCodeRedemption.order' - db.alter_column('shoppingcart_registrationcoderedemption', 'order_id', self.gf('django.db.models.fields.related.ForeignKey')(default='', to=orm['shoppingcart.Order'])) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 9, 3, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 9, 3, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 9, 3, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py b/lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py deleted file mode 100644 index 012e7e2d4c..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py +++ /dev/null @@ -1,189 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Donation' - db.create_table('shoppingcart_donation', ( - ('orderitem_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['shoppingcart.OrderItem'], unique=True, primary_key=True)), - ('donation_type', self.gf('django.db.models.fields.CharField')(default='general', max_length=32)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - )) - db.send_create_signal('shoppingcart', ['Donation']) - - def backwards(self, orm): - # Deleting model 'Donation' - db.delete_table('shoppingcart_donation') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 2, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 2, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 2, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py b/lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py deleted file mode 100644 index d7364612bc..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'DonationConfiguration' - db.create_table('shoppingcart_donationconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('shoppingcart', ['DonationConfiguration']) - - def backwards(self, orm): - # Deleting model 'DonationConfiguration' - db.delete_table('shoppingcart_donationconfiguration') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 3, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 3, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 3, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel.py b/lms/djangoapps/shoppingcart/migrations/0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel.py deleted file mode 100644 index af49f01c0a..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel.py +++ /dev/null @@ -1,282 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseRegCodeItem' - db.create_table('shoppingcart_courseregcodeitem', ( - ('orderitem_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['shoppingcart.OrderItem'], unique=True, primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=128, db_index=True)), - ('mode', self.gf('django.db.models.fields.SlugField')(default='honor', max_length=50)), - )) - db.send_create_signal('shoppingcart', ['CourseRegCodeItem']) - - # Adding model 'CourseRegCodeItemAnnotation' - db.create_table('shoppingcart_courseregcodeitemannotation', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=128, db_index=True)), - ('annotation', self.gf('django.db.models.fields.TextField')(null=True)), - )) - db.send_create_signal('shoppingcart', ['CourseRegCodeItemAnnotation']) - - # Adding field 'Order.company_name' - db.add_column('shoppingcart_order', 'company_name', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.company_contact_name' - db.add_column('shoppingcart_order', 'company_contact_name', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.company_contact_email' - db.add_column('shoppingcart_order', 'company_contact_email', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.recipient_name' - db.add_column('shoppingcart_order', 'recipient_name', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.recipient_email' - db.add_column('shoppingcart_order', 'recipient_email', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.customer_reference_number' - db.add_column('shoppingcart_order', 'customer_reference_number', - self.gf('django.db.models.fields.CharField')(max_length=63, null=True, blank=True), - keep_default=False) - - # Adding field 'Order.order_type' - db.add_column('shoppingcart_order', 'order_type', - self.gf('django.db.models.fields.CharField')(default='personal', max_length=32), - keep_default=False) - - def backwards(self, orm): - # Deleting model 'CourseRegCodeItem' - db.delete_table('shoppingcart_courseregcodeitem') - - # Deleting model 'CourseRegCodeItemAnnotation' - db.delete_table('shoppingcart_courseregcodeitemannotation') - - # Deleting field 'Order.company_name' - db.delete_column('shoppingcart_order', 'company_name') - - # Deleting field 'Order.company_contact_name' - db.delete_column('shoppingcart_order', 'company_contact_name') - - # Deleting field 'Order.company_contact_email' - db.delete_column('shoppingcart_order', 'company_contact_email') - - # Deleting field 'Order.recipient_name' - db.delete_column('shoppingcart_order', 'recipient_name') - - # Deleting field 'Order.recipient_email' - db.delete_column('shoppingcart_order', 'recipient_email') - - # Deleting field 'Order.customer_reference_number' - db.delete_column('shoppingcart_order', 'customer_reference_number') - - # Deleting field 'Order.order_type' - db.delete_column('shoppingcart_order', 'order_type') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 16, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 16, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 10, 16, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py b/lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py deleted file mode 100644 index 226d2475e8..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py +++ /dev/null @@ -1,222 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'OrderItem.created' - db.add_column('shoppingcart_orderitem', 'created', - self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), - keep_default=False) - - # Adding field 'OrderItem.modified' - db.add_column('shoppingcart_orderitem', 'modified', - self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'OrderItem.created' - db.delete_column('shoppingcart_orderitem', 'created') - - # Deleting field 'OrderItem.modified' - db.delete_column('shoppingcart_orderitem', 'modified') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 11, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 11, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 11, 6, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py b/lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py deleted file mode 100644 index 76116de7cb..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py +++ /dev/null @@ -1,226 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'RegistrationCodeRedemption.course_enrollment' - db.add_column('shoppingcart_registrationcoderedemption', 'course_enrollment', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['student.CourseEnrollment'], null=True), - keep_default=False) - - # Adding field 'PaidCourseRegistration.course_enrollment' - db.add_column('shoppingcart_paidcourseregistration', 'course_enrollment', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['student.CourseEnrollment'], null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'RegistrationCodeRedemption.course_enrollment' - db.delete_column('shoppingcart_registrationcoderedemption', 'course_enrollment_id') - - # Deleting field 'PaidCourseRegistration.course_enrollment' - db.delete_column('shoppingcart_paidcourseregistration', 'course_enrollment_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 19, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 19, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 19, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] \ No newline at end of file diff --git a/lms/djangoapps/shoppingcart/migrations/0023_auto__add_field_coupon_expiration_date.py b/lms/djangoapps/shoppingcart/migrations/0023_auto__add_field_coupon_expiration_date.py deleted file mode 100644 index e109500dc3..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0023_auto__add_field_coupon_expiration_date.py +++ /dev/null @@ -1,219 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'Coupon.expiration_date' - db.add_column('shoppingcart_coupon', 'expiration_date', - self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Coupon.expiration_date' - db.delete_column('shoppingcart_coupon', 'expiration_date') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 6, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 6, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] \ No newline at end of file diff --git a/lms/djangoapps/shoppingcart/migrations/0024_auto__add_field_courseregistrationcode_mode_slug.py b/lms/djangoapps/shoppingcart/migrations/0024_auto__add_field_courseregistrationcode_mode_slug.py deleted file mode 100644 index 105e441fb3..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0024_auto__add_field_courseregistrationcode_mode_slug.py +++ /dev/null @@ -1,218 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseRegistrationCode.mode_slug' - db.add_column('shoppingcart_courseregistrationcode', 'mode_slug', - self.gf('django.db.models.fields.CharField')(max_length=100, null=True), - keep_default=False) - - def backwards(self, orm): - # Deleting field 'CourseRegistrationCode.mode_slug' - db.delete_column('shoppingcart_courseregistrationcode', 'mode_slug') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 12, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 12, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 12, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0025_update_invoice_models.py b/lms/djangoapps/shoppingcart/migrations/0025_update_invoice_models.py deleted file mode 100644 index 5dfcc3c023..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0025_update_invoice_models.py +++ /dev/null @@ -1,310 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'InvoiceTransaction' - db.create_table('shoppingcart_invoicetransaction', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('invoice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Invoice'])), - ('amount', self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2)), - ('currency', self.gf('django.db.models.fields.CharField')(default='usd', max_length=8)), - ('comments', self.gf('django.db.models.fields.TextField')(null=True)), - ('status', self.gf('django.db.models.fields.CharField')(default='started', max_length=32)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('last_modified_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='last_modified_by_user', to=orm['auth.User'])), - )) - db.send_create_signal('shoppingcart', ['InvoiceTransaction']) - - # Adding model 'InvoiceItem' - db.create_table('shoppingcart_invoiceitem', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('invoice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Invoice'])), - ('qty', self.gf('django.db.models.fields.IntegerField')(default=1)), - ('unit_price', self.gf('django.db.models.fields.DecimalField')(default=0.0, max_digits=30, decimal_places=2)), - ('currency', self.gf('django.db.models.fields.CharField')(default='usd', max_length=8)), - )) - db.send_create_signal('shoppingcart', ['InvoiceItem']) - - # Adding model 'CourseRegistrationCodeInvoiceItem' - db.create_table('shoppingcart_courseregistrationcodeinvoiceitem', ( - ('invoiceitem_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['shoppingcart.InvoiceItem'], unique=True, primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=128, db_index=True)), - )) - db.send_create_signal('shoppingcart', ['CourseRegistrationCodeInvoiceItem']) - - # Adding field 'CourseRegistrationCode.invoice_item' - db.add_column('shoppingcart_courseregistrationcode', 'invoice_item', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.CourseRegistrationCodeInvoiceItem'], null=True), - keep_default=True) - - # Adding field 'Invoice.created' - db.add_column('shoppingcart_invoice', 'created', - self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), - keep_default=True) - - # Adding field 'Invoice.modified' - db.add_column('shoppingcart_invoice', 'modified', - self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now), - keep_default=True) - - - def backwards(self, orm): - # Deleting model 'InvoiceTransaction' - db.delete_table('shoppingcart_invoicetransaction') - - # Deleting model 'InvoiceItem' - db.delete_table('shoppingcart_invoiceitem') - - # Deleting model 'CourseRegistrationCodeInvoiceItem' - db.delete_table('shoppingcart_courseregistrationcodeinvoiceitem') - - # Deleting field 'CourseRegistrationCode.invoice_item' - db.delete_column('shoppingcart_courseregistrationcode', 'invoice_item_id') - - # Deleting field 'Invoice.created' - db.delete_column('shoppingcart_invoice', 'created') - - # Deleting field 'Invoice.modified' - db.delete_column('shoppingcart_invoice', 'modified') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'invoice_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCodeInvoiceItem']", 'null': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.courseregistrationcodeinvoiceitem': { - 'Meta': {'object_name': 'CourseRegistrationCodeInvoiceItem', '_ormbases': ['shoppingcart.InvoiceItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'invoiceitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.InvoiceItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.invoiceitem': { - 'Meta': {'object_name': 'InvoiceItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'unit_price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}) - }, - 'shoppingcart.invoicetransaction': { - 'Meta': {'object_name': 'InvoiceTransaction'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_modified_by_user'", 'to': "orm['auth.User']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '32'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] \ No newline at end of file diff --git a/lms/djangoapps/shoppingcart/migrations/0026_migrate_invoices.py b/lms/djangoapps/shoppingcart/migrations/0026_migrate_invoices.py deleted file mode 100644 index 787c8907f1..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0026_migrate_invoices.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models -from decimal import Decimal, ROUND_DOWN - -class Migration(DataMigration): - - def forwards(self, orm): - # Select all the invoices and number of registration codes(as qty) associated with every invoice - invoices = orm.Invoice.objects.extra( - select={ - 'qty': 'SELECT COUNT(*) FROM shoppingcart_courseregistrationcode ' - 'WHERE shoppingcart_courseregistrationcode.invoice_id = shoppingcart_invoice.id' - } - ).all() - for invoice in invoices: - invoice_item = self._create_invoice_item(invoice, orm) - orm.CourseRegistrationCode.objects.filter(invoice=invoice).update(invoice_item=invoice_item) - - def backwards(self, orm): - """ - We don't need the backward migration because the data is already there in old models and - schema rollback will automatically remove this new data. - """ - pass - - @staticmethod - def _create_invoice_item(invoice, orm): - unit_price = ((Decimal(invoice.total_amount))/invoice.qty).quantize(Decimal('.01'), rounding=ROUND_DOWN) - invoice_item = orm.CourseRegistrationCodeInvoiceItem.objects.create( - invoice=invoice, - qty=invoice.qty, - unit_price=unit_price, - course_id=invoice.course_id - ) - return invoice_item - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'invoice_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCodeInvoiceItem']", 'null': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.courseregistrationcodeinvoiceitem': { - 'Meta': {'object_name': 'CourseRegistrationCodeInvoiceItem', '_ormbases': ['shoppingcart.InvoiceItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'invoiceitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.InvoiceItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.invoiceitem': { - 'Meta': {'object_name': 'InvoiceItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'unit_price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}) - }, - 'shoppingcart.invoicetransaction': { - 'Meta': {'object_name': 'InvoiceTransaction'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_modified_by_user'", 'to': "orm['auth.User']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '32'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 1, 27, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] - symmetrical = True diff --git a/lms/djangoapps/shoppingcart/migrations/0027_add_invoice_history.py b/lms/djangoapps/shoppingcart/migrations/0027_add_invoice_history.py deleted file mode 100644 index 57e1e9822c..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0027_add_invoice_history.py +++ /dev/null @@ -1,262 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'InvoiceHistory' - db.create_table('shoppingcart_invoicehistory', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('invoice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['shoppingcart.Invoice'])), - ('snapshot', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('shoppingcart', ['InvoiceHistory']) - - - def backwards(self, orm): - # Deleting model 'InvoiceHistory' - db.delete_table('shoppingcart_invoicehistory') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 2, 8, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 2, 8, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'invoice_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCodeInvoiceItem']", 'null': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.courseregistrationcodeinvoiceitem': { - 'Meta': {'object_name': 'CourseRegistrationCodeInvoiceItem', '_ormbases': ['shoppingcart.InvoiceItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'invoiceitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.InvoiceItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.invoicehistory': { - 'Meta': {'object_name': 'InvoiceHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'snapshot': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) - }, - 'shoppingcart.invoiceitem': { - 'Meta': {'object_name': 'InvoiceItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'unit_price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}) - }, - 'shoppingcart.invoicetransaction': { - 'Meta': {'object_name': 'InvoiceTransaction'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_modified_by_user'", 'to': "orm['auth.User']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '32'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 2, 8, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0028_auto__add_field_courseregistrationcode_is_valid.py b/lms/djangoapps/shoppingcart/migrations/0028_auto__add_field_courseregistrationcode_is_valid.py deleted file mode 100644 index f82bff4a97..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0028_auto__add_field_courseregistrationcode_is_valid.py +++ /dev/null @@ -1,259 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseRegistrationCode.is_valid' - db.add_column('shoppingcart_courseregistrationcode', 'is_valid', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseRegistrationCode.is_valid' - db.delete_column('shoppingcart_courseregistrationcode', 'is_valid') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 5, 29, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 5, 29, 0, 0)'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'invoice_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCodeInvoiceItem']", 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.courseregistrationcodeinvoiceitem': { - 'Meta': {'object_name': 'CourseRegistrationCodeInvoiceItem', '_ormbases': ['shoppingcart.InvoiceItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'invoiceitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.InvoiceItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.invoicehistory': { - 'Meta': {'object_name': 'InvoiceHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'snapshot': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) - }, - 'shoppingcart.invoiceitem': { - 'Meta': {'object_name': 'InvoiceItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'unit_price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}) - }, - 'shoppingcart.invoicetransaction': { - 'Meta': {'object_name': 'InvoiceTransaction'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_modified_by_user'", 'to': "orm['auth.User']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '32'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2015, 5, 29, 0, 0)', 'null': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] \ No newline at end of file diff --git a/lms/djangoapps/shoppingcart/migrations/0029_better_datetime_now_default.py b/lms/djangoapps/shoppingcart/migrations/0029_better_datetime_now_default.py deleted file mode 100644 index 765babb8a9..0000000000 --- a/lms/djangoapps/shoppingcart/migrations/0029_better_datetime_now_default.py +++ /dev/null @@ -1,269 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'CourseRegistrationCode.created_at' - db.alter_column('shoppingcart_courseregistrationcode', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True)) - - # Changing field 'Coupon.created_at' - db.alter_column('shoppingcart_coupon', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True)) - - # Changing field 'RegistrationCodeRedemption.redeemed_at' - db.alter_column('shoppingcart_registrationcoderedemption', 'redeemed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True)) - - def backwards(self, orm): - - # Changing field 'CourseRegistrationCode.created_at' - db.alter_column('shoppingcart_courseregistrationcode', 'created_at', self.gf('django.db.models.fields.DateTimeField')()) - - # Changing field 'Coupon.created_at' - db.alter_column('shoppingcart_coupon', 'created_at', self.gf('django.db.models.fields.DateTimeField')()) - - # Changing field 'RegistrationCodeRedemption.redeemed_at' - db.alter_column('shoppingcart_registrationcoderedemption', 'redeemed_at', self.gf('django.db.models.fields.DateTimeField')(null=True)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'shoppingcart.certificateitem': { - 'Meta': {'object_name': 'CertificateItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.coupon': { - 'Meta': {'object_name': 'Coupon'}, - 'code': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'percentage_discount': ('django.db.models.fields.IntegerField', [], {'default': '0'}) - }, - 'shoppingcart.couponredemption': { - 'Meta': {'object_name': 'CouponRedemption'}, - 'coupon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Coupon']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.courseregcodeitem': { - 'Meta': {'object_name': 'CourseRegCodeItem', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.courseregcodeitemannotation': { - 'Meta': {'object_name': 'CourseRegCodeItemAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.courseregistrationcode': { - 'Meta': {'object_name': 'CourseRegistrationCode'}, - 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_by_user'", 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']", 'null': 'True'}), - 'invoice_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCodeInvoiceItem']", 'null': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'purchase_order'", 'null': 'True', 'to': "orm['shoppingcart.Order']"}) - }, - 'shoppingcart.courseregistrationcodeinvoiceitem': { - 'Meta': {'object_name': 'CourseRegistrationCodeInvoiceItem', '_ormbases': ['shoppingcart.InvoiceItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'invoiceitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.InvoiceItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donation': { - 'Meta': {'object_name': 'Donation', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'donation_type': ('django.db.models.fields.CharField', [], {'default': "'general'", 'max_length': '32'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.donationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'DonationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.invoice': { - 'Meta': {'object_name': 'Invoice'}, - 'address_line_1': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'address_line_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'address_line_3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), - 'total_amount': ('django.db.models.fields.FloatField', [], {}), - 'zip': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}) - }, - 'shoppingcart.invoicehistory': { - 'Meta': {'object_name': 'InvoiceHistory'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'snapshot': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) - }, - 'shoppingcart.invoiceitem': { - 'Meta': {'object_name': 'InvoiceItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'unit_price': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}) - }, - 'shoppingcart.invoicetransaction': { - 'Meta': {'object_name': 'InvoiceTransaction'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Invoice']"}), - 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_modified_by_user'", 'to': "orm['auth.User']"}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '32'}) - }, - 'shoppingcart.order': { - 'Meta': {'object_name': 'Order'}, - 'bill_to_cardtype': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), - 'bill_to_ccnum': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_country': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_first': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_last': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), - 'bill_to_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}), - 'bill_to_state': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), - 'bill_to_street1': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'bill_to_street2': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), - 'company_contact_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_contact_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'company_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'customer_reference_number': ('django.db.models.fields.CharField', [], {'max_length': '63', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order_type': ('django.db.models.fields.CharField', [], {'default': "'personal'", 'max_length': '32'}), - 'processor_reply_dump': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'purchase_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'recipient_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'recipient_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'refunded_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.orderitem': { - 'Meta': {'object_name': 'OrderItem'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'fulfilled_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'line_desc': ('django.db.models.fields.CharField', [], {'default': "'Misc. Item'", 'max_length': '1024'}), - 'list_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '30', 'decimal_places': '2'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']"}), - 'qty': ('django.db.models.fields.IntegerField', [], {'default': '1'}), - 'refund_requested_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'report_comments': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'service_fee': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'cart'", 'max_length': '32', 'db_index': 'True'}), - 'unit_cost': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'max_digits': '30', 'decimal_places': '2'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'shoppingcart.paidcourseregistration': { - 'Meta': {'object_name': 'PaidCourseRegistration', '_ormbases': ['shoppingcart.OrderItem']}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '128', 'db_index': 'True'}), - 'mode': ('django.db.models.fields.SlugField', [], {'default': "'honor'", 'max_length': '50'}), - 'orderitem_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['shoppingcart.OrderItem']", 'unique': 'True', 'primary_key': 'True'}) - }, - 'shoppingcart.paidcourseregistrationannotation': { - 'Meta': {'object_name': 'PaidCourseRegistrationAnnotation'}, - 'annotation': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'shoppingcart.registrationcoderedemption': { - 'Meta': {'object_name': 'RegistrationCodeRedemption'}, - 'course_enrollment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['student.CourseEnrollment']", 'null': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.Order']", 'null': 'True'}), - 'redeemed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), - 'redeemed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'registration_code': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shoppingcart.CourseRegistrationCode']"}) - }, - 'student.courseenrollment': { - 'Meta': {'ordering': "('user', 'course_id')", 'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'mode': ('django.db.models.fields.CharField', [], {'default': "'honor'", 'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['shoppingcart'] \ No newline at end of file diff --git a/lms/djangoapps/shoppingcart/models.py b/lms/djangoapps/shoppingcart/models.py index ac3ca6c60f..91f9596ff0 100644 --- a/lms/djangoapps/shoppingcart/models.py +++ b/lms/djangoapps/shoppingcart/models.py @@ -7,7 +7,7 @@ from decimal import Decimal import json import analytics from io import BytesIO -from django.db.models import Q +from django.db.models import Q, F import pytz import logging import smtplib @@ -109,6 +109,9 @@ class Order(models.Model): as the shopping cart. FOR ANY USER, THERE SHOULD ONLY EVER BE ZERO OR ONE ORDER WITH STATUS='cart'. """ + class Meta(object): + app_label = "shoppingcart" + user = models.ForeignKey(User, db_index=True) currency = models.CharField(default="usd", max_length=8) # lower case ISO currency codes status = models.CharField(max_length=32, default='cart', choices=ORDER_STATUSES) @@ -230,7 +233,7 @@ class Order(models.Model): """ self.orderitem_set.all().delete() # pylint: disable=no-member - @transaction.commit_on_success + @transaction.atomic def start_purchase(self): """ Start the purchase process. This will set the order status to "paying", @@ -632,6 +635,9 @@ class OrderItem(TimeStampedModel): Each implementation of OrderItem should provide its own purchased_callback as a method. """ + class Meta(object): + app_label = "shoppingcart" + objects = InheritanceManager() order = models.ForeignKey(Order, db_index=True) # this is denormalized, but convenient for SQL queries for reports, etc. user should always be = order.user @@ -669,7 +675,7 @@ class OrderItem(TimeStampedModel): if order.currency != currency and order.orderitem_set.exists(): raise InvalidCartItem(_("Trying to add a different currency into the cart")) - @transaction.commit_on_success + @transaction.atomic def purchase_item(self): """ This is basically a wrapper around purchased_callback that handles @@ -803,6 +809,9 @@ class Invoice(TimeStampedModel): which is when a user wants to purchase Registration Codes, but will not do so via a Credit Card transaction. """ + class Meta(object): + app_label = "shoppingcart" + company_name = models.CharField(max_length=255, db_index=True) company_contact_name = models.CharField(max_length=255) company_contact_email = models.CharField(max_length=255) @@ -972,6 +981,9 @@ class InvoiceTransaction(TimeStampedModel): the refund. """ + class Meta(object): + app_label = "shoppingcart" + invoice = models.ForeignKey(Invoice) amount = models.DecimalField( default=0.0, decimal_places=2, max_digits=30, @@ -1021,7 +1033,10 @@ class InvoiceTransaction(TimeStampedModel): returns the total amount of the paid invoices. """ result = cls.objects.filter(amount__gt=0, invoice__course_id=course_key, status='completed').aggregate( - total=Sum('amount') + total=Sum( + 'amount', + output_field=models.DecimalField(decimal_places=2, max_digits=30) + ) ) total = result.get('total', 0) @@ -1056,6 +1071,9 @@ class InvoiceItem(TimeStampedModel): codes for the DemoX course. """ + class Meta(object): + app_label = "shoppingcart" + objects = InheritanceManager() invoice = models.ForeignKey(Invoice, db_index=True) qty = models.IntegerField( @@ -1096,6 +1114,9 @@ class CourseRegistrationCodeInvoiceItem(InvoiceItem): a course registration. """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(max_length=128, db_index=True) def snapshot(self): @@ -1166,6 +1187,7 @@ class InvoiceHistory(models.Model): class Meta(object): get_latest_by = "timestamp" + app_label = "shoppingcart" # Hook up Django signals to record changes in the history table. @@ -1187,6 +1209,9 @@ class CourseRegistrationCode(models.Model): This table contains registration codes With registration code, a user can register for a course for free """ + class Meta(object): + app_label = "shoppingcart" + code = models.CharField(max_length=32, db_index=True, unique=True) course_id = CourseKeyField(max_length=255, db_index=True) created_by = models.ForeignKey(User, related_name='created_by_user') @@ -1222,6 +1247,9 @@ class RegistrationCodeRedemption(models.Model): """ This model contains the registration-code redemption info """ + class Meta(object): + app_label = "shoppingcart" + order = models.ForeignKey(Order, db_index=True, null=True) registration_code = models.ForeignKey(CourseRegistrationCode, db_index=True) redeemed_by = models.ForeignKey(User, db_index=True) @@ -1276,18 +1304,18 @@ class RegistrationCodeRedemption(models.Model): class SoftDeleteCouponManager(models.Manager): """ Use this manager to get objects that have a is_active=True """ - - def get_active_coupons_query_set(self): + # pylint: disable=super-on-old-class + def get_active_coupons_queryset(self): """ filter the is_active = True Coupons only """ - return super(SoftDeleteCouponManager, self).get_query_set().filter(is_active=True) + return super(SoftDeleteCouponManager, self).get_queryset().filter(is_active=True) - def get_query_set(self): + def get_queryset(self): """ get all the coupon objects """ - return super(SoftDeleteCouponManager, self).get_query_set() + return super(SoftDeleteCouponManager, self).get_queryset() class Coupon(models.Model): @@ -1295,6 +1323,9 @@ class Coupon(models.Model): This table contains coupon codes A user can get a discount offer on course if provide coupon code """ + class Meta(object): + app_label = "shoppingcart" + code = models.CharField(max_length=32, db_index=True) description = models.CharField(max_length=255, null=True, blank=True) course_id = CourseKeyField(max_length=255) @@ -1321,6 +1352,9 @@ class CouponRedemption(models.Model): """ This table contain coupon redemption info """ + class Meta(object): + app_label = "shoppingcart" + order = models.ForeignKey(Order, db_index=True) user = models.ForeignKey(User, db_index=True) coupon = models.ForeignKey(Coupon, db_index=True) @@ -1434,6 +1468,9 @@ class PaidCourseRegistration(OrderItem): """ This is an inventory item for paying for a course registration """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(max_length=128, db_index=True) mode = models.SlugField(default=CourseMode.DEFAULT_MODE_SLUG) course_enrollment = models.ForeignKey(CourseEnrollment, null=True) @@ -1475,7 +1512,10 @@ class PaidCourseRegistration(OrderItem): """ total_cost = 0 result = cls.objects.filter(course_id=course_key, status=status).aggregate( - total=Sum('unit_cost', field='qty * unit_cost') + total=Sum( + F('qty') * F('unit_cost'), + output_field=models.DecimalField(decimal_places=2, max_digits=30) + ) ) if result['total'] is not None: @@ -1484,7 +1524,7 @@ class PaidCourseRegistration(OrderItem): return total_cost @classmethod - @transaction.commit_on_success + @transaction.atomic def add_to_order(cls, order, course_id, mode_slug=CourseMode.DEFAULT_MODE_SLUG, cost=None, currency=None): """ A standardized way to create these objects, with sensible defaults filled in. @@ -1615,6 +1655,9 @@ class CourseRegCodeItem(OrderItem): This is an inventory item for paying for generating course registration codes """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(max_length=128, db_index=True) mode = models.SlugField(default=CourseMode.DEFAULT_MODE_SLUG) @@ -1649,7 +1692,10 @@ class CourseRegCodeItem(OrderItem): """ total_cost = 0 result = cls.objects.filter(course_id=course_key, status=status).aggregate( - total=Sum('unit_cost', field='qty * unit_cost') + total=Sum( + F('qty') * F('unit_cost'), + output_field=models.DecimalField(decimal_places=2, max_digits=30) + ) ) if result['total'] is not None: @@ -1658,7 +1704,7 @@ class CourseRegCodeItem(OrderItem): return total_cost @classmethod - @transaction.commit_on_success + @transaction.atomic def add_to_order(cls, order, course_id, qty, mode_slug=CourseMode.DEFAULT_MODE_SLUG, cost=None, currency=None): # pylint: disable=arguments-differ """ A standardized way to create these objects, with sensible defaults filled in. @@ -1775,6 +1821,9 @@ class CourseRegCodeItemAnnotation(models.Model): And unfortunately we didn't have the concept of a "SKU" or stock item where we could keep this association, so this is to retrofit it. """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(unique=True, max_length=128, db_index=True) annotation = models.TextField(null=True) @@ -1790,6 +1839,9 @@ class PaidCourseRegistrationAnnotation(models.Model): And unfortunately we didn't have the concept of a "SKU" or stock item where we could keep this association, so this is to retrofit it. """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(unique=True, max_length=128, db_index=True) annotation = models.TextField(null=True) @@ -1802,6 +1854,9 @@ class CertificateItem(OrderItem): """ This is an inventory item for purchasing certificates """ + class Meta(object): + app_label = "shoppingcart" + course_id = CourseKeyField(max_length=128, db_index=True) course_enrollment = models.ForeignKey(CourseEnrollment) mode = models.SlugField() @@ -1860,7 +1915,7 @@ class CertificateItem(OrderItem): return target_cert @classmethod - @transaction.commit_on_success + @transaction.atomic def add_to_order(cls, order, course_id, cost, mode, currency='usd'): """ Add a CertificateItem to an order @@ -2010,7 +2065,8 @@ class CertificateItem(OrderItem): class DonationConfiguration(ConfigurationModel): """Configure whether donations are enabled on the site.""" - pass + class Meta(ConfigurationModel.Meta): + app_label = "shoppingcart" class Donation(OrderItem): @@ -2020,6 +2076,9 @@ class Donation(OrderItem): Users can choose the donation amount. """ + class Meta(object): + app_label = "shoppingcart" + # Types of donations DONATION_TYPES = ( ("general", "A general donation"), @@ -2035,7 +2094,7 @@ class Donation(OrderItem): course_id = CourseKeyField(max_length=255, db_index=True) @classmethod - @transaction.commit_on_success + @transaction.atomic def add_to_order(cls, order, donation_amount, course_id=None, currency='usd'): """Add a donation to an order. diff --git a/lms/djangoapps/shoppingcart/tests/test_microsites.py b/lms/djangoapps/shoppingcart/tests/test_microsites.py index b3a4801021..b0dd3110c1 100644 --- a/lms/djangoapps/shoppingcart/tests/test_microsites.py +++ b/lms/djangoapps/shoppingcart/tests/test_microsites.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Tests for Microsite Dashboard with Shopping Cart History """ @@ -134,11 +135,13 @@ class TestOrderHistoryOnMicrositeDashboard(ModuleStoreTestCase): receipt_url_cert_non_microsite = reverse('shoppingcart.views.show_receipt', kwargs={'ordernum': self.orderid_cert_non_microsite}) receipt_url_donation = reverse('shoppingcart.views.show_receipt', kwargs={'ordernum': self.orderid_donation}) - self.assertIn(receipt_url_microsite_course, response.content) - self.assertNotIn(receipt_url_microsite_course2, response.content) - self.assertNotIn(receipt_url_non_microsite, response.content) - self.assertNotIn(receipt_url_cert_non_microsite, response.content) - self.assertNotIn(receipt_url_donation, response.content) + # We need to decode because of these chars: © & ▸ + content = response.content.decode('utf-8') + self.assertIn(receipt_url_microsite_course, content) + self.assertNotIn(receipt_url_microsite_course2, content) + self.assertNotIn(receipt_url_non_microsite, content) + self.assertNotIn(receipt_url_cert_non_microsite, content) + self.assertNotIn(receipt_url_donation, content) @mock.patch("microsite_configuration.microsite.get_value", non_microsite) @mock.patch("microsite_configuration.microsite.get_all_orgs", fake_all_orgs) @@ -152,9 +155,11 @@ class TestOrderHistoryOnMicrositeDashboard(ModuleStoreTestCase): receipt_url_donation = reverse('shoppingcart.views.show_receipt', kwargs={'ordernum': self.orderid_donation}) receipt_url_courseless_donation = reverse('shoppingcart.views.show_receipt', kwargs={'ordernum': self.orderid_courseless_donation}) - self.assertNotIn(receipt_url_microsite_course, response.content) - self.assertNotIn(receipt_url_microsite_course2, response.content) - self.assertIn(receipt_url_non_microsite, response.content) - self.assertIn(receipt_url_cert_non_microsite, response.content) - self.assertIn(receipt_url_donation, response.content) - self.assertIn(receipt_url_courseless_donation, response.content) + # We need to decode because of these chars: © & ▸ + content = response.content.decode('utf-8') + self.assertNotIn(receipt_url_microsite_course, content) + self.assertNotIn(receipt_url_microsite_course2, content) + self.assertIn(receipt_url_non_microsite, content) + self.assertIn(receipt_url_cert_non_microsite, content) + self.assertIn(receipt_url_donation, content) + self.assertIn(receipt_url_courseless_donation, content) diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py index b2441a31cb..b7da4f59eb 100644 --- a/lms/djangoapps/shoppingcart/tests/test_models.py +++ b/lms/djangoapps/shoppingcart/tests/test_models.py @@ -253,13 +253,13 @@ class OrderTest(ModuleStoreTestCase): { 'orderId': 1, 'currency': 'usd', - 'total': '40', + 'total': '40.00', 'products': [ { 'sku': u'CertificateItem.honor', 'name': unicode(self.course_key), 'category': unicode(self.course_key.org), - 'price': '40', + 'price': '40.00', 'id': 1, 'quantity': 1 } @@ -848,13 +848,13 @@ class CertificateItemTest(ModuleStoreTestCase): { 'orderId': 1, 'currency': 'usd', - 'total': '40', + 'total': '40.00', 'products': [ { 'sku': u'CertificateItem.verified', 'name': unicode(self.course_key), 'category': unicode(self.course_key.org), - 'price': '40', + 'price': '40.00', 'id': 1, 'quantity': 1 } diff --git a/lms/djangoapps/shoppingcart/tests/test_reports.py b/lms/djangoapps/shoppingcart/tests/test_reports.py index 388f701cb3..a2304cceff 100644 --- a/lms/djangoapps/shoppingcart/tests/test_reports.py +++ b/lms/djangoapps/shoppingcart/tests/test_reports.py @@ -84,7 +84,7 @@ class ReportTypeTests(ModuleStoreTestCase): self.cart = Order.get_cart_for_user(self.second_refund_user) CertificateItem.add_to_order(self.cart, self.course_key, self.cost, 'verified') - self.cart.purchase(self.second_refund_user, self.course_key) + self.cart.purchase(self.second_refund_user.username, self.course_key) CourseEnrollment.unenroll(self.second_refund_user, self.course_key) self.test_time = datetime.datetime.now(pytz.UTC) @@ -101,8 +101,8 @@ class ReportTypeTests(ModuleStoreTestCase): self.CORRECT_REFUND_REPORT_CSV = dedent(""" Order Number,Customer Name,Date of Original Transaction,Date of Refund,Amount of Refund,Service Fees (if any) - 3,King Bowsér,{time_str},{time_str},40,0 - 4,Súsan Smith,{time_str},{time_str},40,0 + 3,King Bowsér,{time_str},{time_str},40.00,0.00 + 4,Súsan Smith,{time_str},{time_str},40.00,0.00 """.format(time_str=str(self.test_time))) self.CORRECT_CERT_STATUS_CSV = dedent(""" @@ -201,8 +201,8 @@ class ItemizedPurchaseReportTest(ModuleStoreTestCase): self.CORRECT_CSV = dedent(""" Purchase Time,Order ID,Status,Quantity,Unit Cost,Total Cost,Currency,Description,Comments - {time_str},1,purchased,1,40,40,usd,Registration for Course: Robot Super Course,Ba\xc3\xbc\xe5\x8c\x85 - {time_str},1,purchased,1,40,40,usd,verified cert for course Robot Super Course, + {time_str},1,purchased,1,40.00,40.00,usd,Registration for Course: Robot Super Course,Ba\xc3\xbc\xe5\x8c\x85 + {time_str},1,purchased,1,40.00,40.00,usd,verified cert for course Robot Super Course, """.format(time_str=str(self.now))) def test_purchased_items_btw_dates(self): diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py index 76b0b04e7b..d914e65c27 100644 --- a/lms/djangoapps/shoppingcart/tests/test_views.py +++ b/lms/djangoapps/shoppingcart/tests/test_views.py @@ -2035,8 +2035,6 @@ class CSVReportViewsTest(SharedModuleStoreTestCase): self.assertIn("There was an error in your date input. It should be formatted as YYYY-MM-DD", response.content.decode('UTF-8')) - CORRECT_CSV_NO_DATE_ITEMIZED_PURCHASE = ",1,purchased,1,40,40,usd,Registration for Course: Robot Super Course," - def test_report_csv_itemized(self): report_type = 'itemized_purchase_report' start_date = '1970-01-01' @@ -2051,7 +2049,10 @@ class CSVReportViewsTest(SharedModuleStoreTestCase): self.assertEqual(response['Content-Type'], 'text/csv') report = initialize_report(report_type, start_date, end_date) self.assertIn(",".join(report.header()), response.content) - self.assertIn(self.CORRECT_CSV_NO_DATE_ITEMIZED_PURCHASE, response.content) + self.assertIn( + ",1,purchased,1,40.00,40.00,usd,Registration for Course: Robot Super Course,", + response.content + ) def test_report_csv_university_revenue_share(self): report_type = 'university_revenue_share' diff --git a/lms/djangoapps/shoppingcart/views.py b/lms/djangoapps/shoppingcart/views.py index 937969c925..4c87b4df44 100644 --- a/lms/djangoapps/shoppingcart/views.py +++ b/lms/djangoapps/shoppingcart/views.py @@ -989,7 +989,7 @@ def csv_report(request): report = initialize_report(report_type, start_date, end_date, start_letter, end_letter) items = report.rows() - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') filename = "purchases_report_{}.csv".format(datetime.datetime.now(pytz.UTC).strftime("%Y-%m-%d-%H-%M-%S")) response['Content-Disposition'] = 'attachment; filename="{}"'.format(filename) report.write_csv(response) diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index bc73f8d338..f67b71b3ab 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -15,7 +15,7 @@ from django.contrib import messages from django.contrib.messages.middleware import MessageMiddleware from django.test import TestCase from django.test.utils import override_settings -from django.test.client import RequestFactory +from django.http import HttpRequest from openedx.core.djangoapps.user_api.accounts.api import activate_account, create_account from openedx.core.djangoapps.user_api.accounts import EMAIL_MAX_LENGTH @@ -434,7 +434,7 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase): self.user = UserFactory.create(username=self.USERNAME, password=self.PASSWORD) self.client.login(username=self.USERNAME, password=self.PASSWORD) - self.request = RequestFactory() + self.request = HttpRequest() self.request.user = self.user # For these tests, two third party auth providers are enabled by default: diff --git a/lms/djangoapps/support/tests/test_refund.py b/lms/djangoapps/support/tests/test_refund.py index 4e7f4a6c82..62df658eeb 100644 --- a/lms/djangoapps/support/tests/test_refund.py +++ b/lms/djangoapps/support/tests/test_refund.py @@ -115,6 +115,6 @@ class RefundTests(ModuleStoreTestCase): response = self.client.get(response.get('location')) # pylint: disable=maybe-no-member self.assertContains(response, "Unenrolled %s from" % self.student) - self.assertContains(response, "Refunded 1 for order id") + self.assertContains(response, "Refunded 1.00 for order id") self.assertFalse(CourseEnrollment.is_enrolled(self.student, self.course_id)) diff --git a/lms/djangoapps/survey/migrations/0001_initial.py b/lms/djangoapps/survey/migrations/0001_initial.py index c2cb7f2307..895abfd5d0 100644 --- a/lms/djangoapps/survey/migrations/0001_initial.py +++ b/lms/djangoapps/survey/migrations/0001_initial.py @@ -1,97 +1,55 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +from django.conf import settings +import model_utils.fields +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'SurveyForm' - db.create_table('survey_surveyform', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)), - ('form', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('survey', ['SurveyForm']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'SurveyAnswer' - db.create_table('survey_surveyanswer', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('form', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['survey.SurveyForm'])), - ('field_name', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('field_value', self.gf('django.db.models.fields.CharField')(max_length=1024)), - )) - db.send_create_signal('survey', ['SurveyAnswer']) - - def backwards(self, orm): - # Deleting model 'SurveyForm' - db.delete_table('survey_surveyform') - - # Deleting model 'SurveyAnswer' - db.delete_table('survey_surveyanswer') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'survey.surveyanswer': { - 'Meta': {'object_name': 'SurveyAnswer'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'field_value': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), - 'form': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['survey.SurveyForm']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'survey.surveyform': { - 'Meta': {'object_name': 'SurveyForm'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'form': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['survey'] + operations = [ + migrations.CreateModel( + name='SurveyAnswer', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('field_name', models.CharField(max_length=255, db_index=True)), + ('field_value', models.CharField(max_length=1024)), + ('course_key', xmodule_django.models.CourseKeyField(max_length=255, null=True, db_index=True)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='SurveyForm', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('name', models.CharField(unique=True, max_length=255, db_index=True)), + ('form', models.TextField()), + ], + options={ + 'abstract': False, + }, + ), + migrations.AddField( + model_name='surveyanswer', + name='form', + field=models.ForeignKey(to='survey.SurveyForm'), + ), + migrations.AddField( + model_name='surveyanswer', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/lms/djangoapps/survey/migrations/0002_auto__add_field_surveyanswer_course_key.py b/lms/djangoapps/survey/migrations/0002_auto__add_field_surveyanswer_course_key.py deleted file mode 100644 index 28ad94775e..0000000000 --- a/lms/djangoapps/survey/migrations/0002_auto__add_field_surveyanswer_course_key.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SurveyAnswer.course_key' - db.add_column('survey_surveyanswer', 'course_key', - self.gf('xmodule_django.models.CourseKeyField')(max_length=255, null=True, db_index=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SurveyAnswer.course_key' - db.delete_column('survey_surveyanswer', 'course_key') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'survey.surveyanswer': { - 'Meta': {'object_name': 'SurveyAnswer'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'field_value': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), - 'form': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['survey.SurveyForm']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'survey.surveyform': { - 'Meta': {'object_name': 'SurveyForm'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'form': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['survey'] \ No newline at end of file diff --git a/lms/djangoapps/teams/management/commands/reindex_course_team.py b/lms/djangoapps/teams/management/commands/reindex_course_team.py index 901789180f..8061ee466f 100644 --- a/lms/djangoapps/teams/management/commands/reindex_course_team.py +++ b/lms/djangoapps/teams/management/commands/reindex_course_team.py @@ -5,7 +5,7 @@ from django.conf import settings from optparse import make_option from textwrap import dedent -from teams.models import CourseTeam +from lms.djangoapps.teams.models import CourseTeam class Command(BaseCommand): @@ -49,7 +49,7 @@ class Command(BaseCommand): """ # This is ugly, but there is a really strange circular dependency that doesn't # happen anywhere else that I can't figure out how to avoid it :( - from teams.search_indexes import CourseTeamIndexer + from ...search_indexes import CourseTeamIndexer if len(args) == 0 and not options.get('all', False): raise CommandError(u"reindex_course_team requires one or more arguments: ") diff --git a/lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py b/lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py index 63b7593bcd..49c5f96430 100644 --- a/lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py +++ b/lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py @@ -5,10 +5,9 @@ import mock from mock import patch from django.core.management import call_command, CommandError from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from common.test.utils import nostderr from opaque_keys.edx.keys import CourseKey -from teams.tests.factories import CourseTeamFactory -from teams.search_indexes import CourseTeamIndexer +from ....tests.factories import CourseTeamFactory +from ....search_indexes import CourseTeamIndexer from search.search_engine_base import SearchEngine COURSE_KEY1 = CourseKey.from_string('edx/history/1') @@ -32,23 +31,21 @@ class ReindexCourseTeamTest(SharedModuleStoreTestCase): def test_given_no_arguments_raises_command_error(self): """ Test that raises CommandError for incorrect arguments. """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments .*"): - call_command('reindex_course_team') + with self.assertRaisesRegexp(CommandError, ".* requires one or more arguments.*"): + call_command('reindex_course_team') + @patch.dict('django.conf.settings.FEATURES', {'ENABLE_TEAMS': False}) def test_teams_search_flag_disabled_raises_command_error(self): """ Test that raises CommandError for disabled feature flag. """ - with mock.patch('django.conf.settings.FEATURES') as features: - features.return_value = {"ENABLE_TEAMS": False} - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* ENABLE_TEAMS must be enabled .*"): - call_command('reindex_course_team') + with self.assertRaisesRegexp(CommandError, ".*ENABLE_TEAMS must be enabled.*"): + call_command('reindex_course_team', self.team1.team_id) def test_given_invalid_team_id_raises_command_error(self): """ Test that raises CommandError for invalid team id. """ - with self.assertRaises(SystemExit), nostderr(): - with self.assertRaisesRegexp(CommandError, ".* Argument {0} is not a course_team id .*"): - call_command('reindex_course_team', u'team4') + team_id = u'team4' + error_str = 'Argument {0} is not a course_team team_id'.format(team_id) + with self.assertRaisesRegexp(CommandError, error_str): + call_command('reindex_course_team', team_id) @patch.object(CourseTeamIndexer, 'index') def test_single_team_id(self, mock_index): diff --git a/lms/djangoapps/teams/migrations/0001_initial.py b/lms/djangoapps/teams/migrations/0001_initial.py index 4e73904d2a..dc6011955b 100644 --- a/lms/djangoapps/teams/migrations/0001_initial.py +++ b/lms/djangoapps/teams/migrations/0001_initial.py @@ -1,110 +1,54 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django_countries.fields +from django.conf import settings +import student.models +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseTeam' - db.create_table('teams_courseteam', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('team_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('topic_id', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=255, blank=True)), - ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('description', self.gf('django.db.models.fields.CharField')(max_length=300)), - ('country', self.gf('django_countries.fields.CountryField')(max_length=2, blank=True)), - ('language', self.gf('student.models.LanguageField')(max_length=16, blank=True)), - )) - db.send_create_signal('teams', ['CourseTeam']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'CourseTeamMembership' - db.create_table('teams_courseteammembership', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('team', self.gf('django.db.models.fields.related.ForeignKey')(related_name='membership', to=orm['teams.CourseTeam'])), - ('date_joined', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - )) - db.send_create_signal('teams', ['CourseTeamMembership']) - - # Adding unique constraint on 'CourseTeamMembership', fields ['user', 'team'] - db.create_unique('teams_courseteammembership', ['user_id', 'team_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CourseTeamMembership', fields ['user', 'team'] - db.delete_unique('teams_courseteammembership', ['user_id', 'team_id']) - - # Deleting model 'CourseTeam' - db.delete_table('teams_courseteam') - - # Deleting model 'CourseTeamMembership' - db.delete_table('teams_courseteammembership') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='CourseTeam', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('team_id', models.CharField(unique=True, max_length=255)), + ('discussion_topic_id', models.CharField(unique=True, max_length=255)), + ('name', models.CharField(max_length=255, db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('topic_id', models.CharField(db_index=True, max_length=255, blank=True)), + ('date_created', models.DateTimeField(auto_now_add=True)), + ('description', models.CharField(max_length=300)), + ('country', django_countries.fields.CountryField(blank=True, max_length=2)), + ('language', student.models.LanguageField(blank=True, help_text='Optional language the team uses as ISO 639-1 code.', max_length=16, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokm\xe5l, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volap\xfck'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']])), + ('last_activity_at', models.DateTimeField(db_index=True)), + ('team_size', models.IntegerField(default=0, db_index=True)), + ], + ), + migrations.CreateModel( + name='CourseTeamMembership', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('date_joined', models.DateTimeField(auto_now_add=True)), + ('last_activity_at', models.DateTimeField()), + ('team', models.ForeignKey(related_name='membership', to='teams.CourseTeam')), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AddField( + model_name='courseteam', + name='users', + field=models.ManyToManyField(related_name='teams', through='teams.CourseTeamMembership', to=settings.AUTH_USER_MODEL, db_index=True), + ), + migrations.AlterUniqueTogether( + name='courseteammembership', + unique_together=set([('user', 'team')]), + ), + ] diff --git a/lms/djangoapps/teams/migrations/0002_auto__add_field_courseteam_discussion_id.py b/lms/djangoapps/teams/migrations/0002_auto__add_field_courseteam_discussion_id.py deleted file mode 100644 index f21feaba4f..0000000000 --- a/lms/djangoapps/teams/migrations/0002_auto__add_field_courseteam_discussion_id.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseTeam.discussion_topic_id' - db.add_column('teams_courseteam', 'discussion_topic_id', - self.gf('django.db.models.fields.CharField')(default='', unique=True, max_length=255), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseTeam.discussion_topic_id' - db.delete_column('teams_courseteam', 'discussion_topic_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'discussion_topic_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] \ No newline at end of file diff --git a/lms/djangoapps/teams/migrations/0003_auto__add_index_courseteam_name.py b/lms/djangoapps/teams/migrations/0003_auto__add_index_courseteam_name.py deleted file mode 100644 index 9fe0ec43b0..0000000000 --- a/lms/djangoapps/teams/migrations/0003_auto__add_index_courseteam_name.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding index on 'CourseTeam', fields ['name'] - db.create_index('teams_courseteam', ['name']) - - - def backwards(self, orm): - # Removing index on 'CourseTeam', fields ['name'] - db.delete_index('teams_courseteam', ['name']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] \ No newline at end of file diff --git a/lms/djangoapps/teams/migrations/0004_auto__add_field_courseteam_discussion_topic_id__add_field_courseteam_l.py b/lms/djangoapps/teams/migrations/0004_auto__add_field_courseteam_discussion_topic_id__add_field_courseteam_l.py deleted file mode 100644 index 024c06d6e6..0000000000 --- a/lms/djangoapps/teams/migrations/0004_auto__add_field_courseteam_discussion_topic_id__add_field_courseteam_l.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -import pytz -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseTeam.last_activity_at' - db.add_column('teams_courseteam', 'last_activity_at', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2015, 8, 17, 0, 0).replace(tzinfo=pytz.utc)), - keep_default=False) - - # Adding field 'CourseTeamMembership.last_activity_at' - db.add_column('teams_courseteammembership', 'last_activity_at', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2015, 8, 17, 0, 0).replace(tzinfo=pytz.utc)), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseTeam.last_activity_at' - db.delete_column('teams_courseteam', 'last_activity_at') - - # Deleting field 'CourseTeamMembership.last_activity_at' - db.delete_column('teams_courseteammembership', 'last_activity_at') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'discussion_topic_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] diff --git a/lms/djangoapps/teams/migrations/0005_add_course_id_and_topic_id_composite_index.py b/lms/djangoapps/teams/migrations/0005_add_course_id_and_topic_id_composite_index.py deleted file mode 100644 index eedd170cce..0000000000 --- a/lms/djangoapps/teams/migrations/0005_add_course_id_and_topic_id_composite_index.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -import pytz -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Create a composite index of course_id and topic_id. - db.create_index('teams_courseteam', ['course_id', 'topic_id']) - - def backwards(self, orm): - # Delete the composite index of course_id and topic_id. - db.delete_index('teams_courseteam', ['course_id', 'topic_id']) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'discussion_topic_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] diff --git a/lms/djangoapps/teams/migrations/0006_add_team_size.py b/lms/djangoapps/teams/migrations/0006_add_team_size.py deleted file mode 100644 index a89c03895c..0000000000 --- a/lms/djangoapps/teams/migrations/0006_add_team_size.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -from teams.models import CourseTeamMembership - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseTeam.team_size' - db.add_column('teams_courseteam', 'team_size', - self.gf('django.db.models.fields.IntegerField')(default=0, db_index=True), - keep_default=False) - - # Adding index on 'CourseTeam', fields ['last_activity_at'] - db.create_index('teams_courseteam', ['last_activity_at']) - - if not db.dry_run: - for team in orm.CourseTeam.objects.all(): - team.team_size = CourseTeamMembership.objects.filter(team=team).count() - team.save() - - def backwards(self, orm): - # Removing index on 'CourseTeam', fields ['last_activity_at'] - db.delete_index('teams_courseteam', ['last_activity_at']) - - # Deleting field 'CourseTeam.team_size' - db.delete_column('teams_courseteam', 'team_size') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'discussion_topic_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'team_size': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] diff --git a/lms/djangoapps/teams/migrations/0007_auto__del_field_courseteam_is_active.py b/lms/djangoapps/teams/migrations/0007_auto__del_field_courseteam_is_active.py deleted file mode 100644 index 1810468dbe..0000000000 --- a/lms/djangoapps/teams/migrations/0007_auto__del_field_courseteam_is_active.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CourseTeam.is_active' - db.delete_column('teams_courseteam', 'is_active') - - - def backwards(self, orm): - # Adding field 'CourseTeam.is_active' - db.add_column('teams_courseteam', 'is_active', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'teams.courseteam': { - 'Meta': {'object_name': 'CourseTeam'}, - 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}), - 'discussion_topic_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('student.models.LanguageField', [], {'max_length': '16', 'blank': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'team_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'team_size': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), - 'topic_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['teams.CourseTeamMembership']", 'to': "orm['auth.User']"}) - }, - 'teams.courseteammembership': { - 'Meta': {'unique_together': "(('user', 'team'),)", 'object_name': 'CourseTeamMembership'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {}), - 'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'membership'", 'to': "orm['teams.CourseTeam']"}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['teams'] \ No newline at end of file diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py index 3308018848..832757a976 100644 --- a/lms/djangoapps/teams/models.py +++ b/lms/djangoapps/teams/models.py @@ -27,8 +27,8 @@ from xmodule_django.models import CourseKeyField from util.model_utils import slugify from student.models import LanguageField, CourseEnrollment from .errors import AlreadyOnTeamInCourse, NotEnrolledInCourseForTeam, ImmutableMembershipFieldException -from teams.utils import emit_team_event -from teams import TEAM_DISCUSSION_CONTEXT +from lms.djangoapps.teams.utils import emit_team_event +from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT @receiver(thread_voted) @@ -74,6 +74,9 @@ def handle_activity(user, post, original_author_id=None): class CourseTeam(models.Model): """This model represents team related info.""" + class Meta(object): + app_label = "teams" + team_id = models.CharField(max_length=255, unique=True) discussion_topic_id = models.CharField(max_length=255, unique=True) name = models.CharField(max_length=255, db_index=True) @@ -154,6 +157,7 @@ class CourseTeamMembership(models.Model): """This model represents the membership of a single user in a single team.""" class Meta(object): + app_label = "teams" unique_together = (('user', 'team'),) user = models.ForeignKey(User) @@ -173,10 +177,17 @@ class CourseTeamMembership(models.Model): # to set the value. Otherwise, we're trying to overwrite # an immutable field. current_value = getattr(self, name, None) - if current_value is not None: - raise ImmutableMembershipFieldException( - "Field %r shouldn't change from %r to %r" % (name, current_value, value) - ) + if value == current_value: + # This is an attempt to set an immutable value to the same value + # to which it's already set. Don't complain - just ignore the attempt. + return + else: + # This is an attempt to set an immutable value to a different value. + # Allow it *only* if the current value is None. + if current_value is not None: + raise ImmutableMembershipFieldException( + "Field %r shouldn't change from %r to %r" % (name, current_value, value) + ) super(CourseTeamMembership, self).__setattr__(name, value) def save(self, *args, **kwargs): diff --git a/lms/djangoapps/teams/plugins.py b/lms/djangoapps/teams/plugins.py index 439b693a5b..9a167da5ce 100644 --- a/lms/djangoapps/teams/plugins.py +++ b/lms/djangoapps/teams/plugins.py @@ -3,7 +3,7 @@ Definition of the course team feature. """ from django.utils.translation import ugettext_noop from courseware.tabs import EnrolledTab -from teams import is_feature_enabled +from . import is_feature_enabled class TeamsTab(EnrolledTab): diff --git a/lms/djangoapps/teams/search_indexes.py b/lms/djangoapps/teams/search_indexes.py index 6dfc070e81..9fcba08d0e 100644 --- a/lms/djangoapps/teams/search_indexes.py +++ b/lms/djangoapps/teams/search_indexes.py @@ -13,7 +13,8 @@ from search.search_engine_base import SearchEngine from request_cache import get_request_or_stub from .errors import ElasticSearchConnectionError -from .serializers import CourseTeamSerializer, CourseTeam +from lms.djangoapps.teams.models import CourseTeam +from .serializers import CourseTeamSerializer def if_search_enabled(f): diff --git a/lms/djangoapps/teams/serializers.py b/lms/djangoapps/teams/serializers.py index 469ad09f61..8444765640 100644 --- a/lms/djangoapps/teams/serializers.py +++ b/lms/djangoapps/teams/serializers.py @@ -11,7 +11,7 @@ from openedx.core.lib.api.serializers import CollapsedReferenceSerializer from openedx.core.lib.api.fields import ExpandableField from openedx.core.djangoapps.user_api.accounts.serializers import UserReadOnlySerializer -from .models import CourseTeam, CourseTeamMembership +from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership class CountryField(serializers.Field): diff --git a/lms/djangoapps/teams/tests/factories.py b/lms/djangoapps/teams/tests/factories.py index 5127e71064..25375a76cb 100644 --- a/lms/djangoapps/teams/tests/factories.py +++ b/lms/djangoapps/teams/tests/factories.py @@ -7,7 +7,7 @@ from uuid import uuid4 import factory from factory.django import DjangoModelFactory -from ..models import CourseTeam, CourseTeamMembership +from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership LAST_ACTIVITY_AT = datetime(2015, 8, 15, 0, 0, 0, tzinfo=pytz.utc) diff --git a/lms/djangoapps/teams/tests/test_models.py b/lms/djangoapps/teams/tests/test_models.py index 753665a473..1938852af2 100644 --- a/lms/djangoapps/teams/tests/test_models.py +++ b/lms/djangoapps/teams/tests/test_models.py @@ -23,11 +23,12 @@ from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from opaque_keys.edx.keys import CourseKey from student.tests.factories import CourseEnrollmentFactory, UserFactory -from .factories import CourseTeamFactory, CourseTeamMembershipFactory -from teams.models import CourseTeam, CourseTeamMembership -from teams import TEAM_DISCUSSION_CONTEXT +from lms.djangoapps.teams.tests.factories import CourseTeamFactory, CourseTeamMembershipFactory +from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership +from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT from util.testing import EventTestMixin + COURSE_KEY1 = CourseKey.from_string('edx/history/1') COURSE_KEY2 = CourseKey.from_string('edx/history/2') @@ -134,7 +135,7 @@ class TeamSignalsTest(EventTestMixin, SharedModuleStoreTestCase): def setUp(self): """Create a user with a team to test signals.""" - super(TeamSignalsTest, self).setUp('teams.utils.tracker') + super(TeamSignalsTest, self).setUp('lms.djangoapps.teams.utils.tracker') self.user = UserFactory.create(username="user") self.moderator = UserFactory.create(username="moderator") self.team = CourseTeamFactory(discussion_topic_id=self.DISCUSSION_TOPIC_ID) diff --git a/lms/djangoapps/teams/tests/test_views.py b/lms/djangoapps/teams/tests/test_views.py index a498a26f30..53ad3a2df2 100644 --- a/lms/djangoapps/teams/tests/test_views.py +++ b/lms/djangoapps/teams/tests/test_views.py @@ -114,7 +114,7 @@ class TestDashboard(SharedModuleStoreTestCase): self.client.login(username=self.user.username, password=self.test_password) # Check the query count on the dashboard With no teams - with self.assertNumQueries(15): + with self.assertNumQueries(17): self.client.get(self.teams_url) # Create some teams @@ -129,7 +129,11 @@ class TestDashboard(SharedModuleStoreTestCase): team.add_user(self.user) # Check the query count on the dashboard again +<<<<<<< HEAD with self.assertNumQueries(19): +======= + with self.assertNumQueries(24): +>>>>>>> origin/release self.client.get(self.teams_url) def test_bad_course_id(self): @@ -466,7 +470,7 @@ class TestListTeamsAPI(EventTestMixin, TeamAPITestCase): """Test cases for the team listing API endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestListTeamsAPI, self).setUp('teams.utils.tracker') + super(TestListTeamsAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), @@ -644,7 +648,7 @@ class TestCreateTeamAPI(EventTestMixin, TeamAPITestCase): """Test cases for the team creation endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestCreateTeamAPI, self).setUp('teams.utils.tracker') + super(TestCreateTeamAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), @@ -855,7 +859,7 @@ class TestDeleteTeamAPI(EventTestMixin, TeamAPITestCase): """Test cases for the team delete endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestDeleteTeamAPI, self).setUp('teams.utils.tracker') + super(TestDeleteTeamAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), @@ -905,7 +909,7 @@ class TestUpdateTeamAPI(EventTestMixin, TeamAPITestCase): """Test cases for the team update endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestUpdateTeamAPI, self).setUp('teams.utils.tracker') + super(TestUpdateTeamAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), @@ -1234,7 +1238,7 @@ class TestCreateMembershipAPI(EventTestMixin, TeamAPITestCase): """Test cases for the membership creation endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestCreateMembershipAPI, self).setUp('teams.utils.tracker') + super(TestCreateMembershipAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), @@ -1398,7 +1402,7 @@ class TestDeleteMembershipAPI(EventTestMixin, TeamAPITestCase): """Test cases for the membership deletion endpoint.""" def setUp(self): # pylint: disable=arguments-differ - super(TestDeleteMembershipAPI, self).setUp('teams.utils.tracker') + super(TestDeleteMembershipAPI, self).setUp('lms.djangoapps.teams.utils.tracker') @ddt.data( (None, 401), diff --git a/lms/djangoapps/teams/views.py b/lms/djangoapps/teams/views.py index b17300e56c..a937015773 100644 --- a/lms/djangoapps/teams/views.py +++ b/lms/djangoapps/teams/views.py @@ -36,9 +36,9 @@ from courseware.courses import get_course_with_access, has_access from student.models import CourseEnrollment, CourseAccessRole from student.roles import CourseStaffRole from django_comment_client.utils import has_discussion_privileges -from teams import is_feature_enabled from util.model_utils import truncate_fields -from .models import CourseTeam, CourseTeamMembership +from . import is_feature_enabled +from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership from .serializers import ( CourseTeamSerializer, CourseTeamCreationSerializer, @@ -421,7 +421,6 @@ class TeamsListView(ExpandableFieldViewMixin, GenericAPIView): username = request.query_params.get('username', None) if username is not None: result_filter.update({'membership__user__username': username}) - topic_id = request.query_params.get('topic_id', None) if topic_id is not None: if topic_id not in [topic['id'] for topic in course_module.teams_configuration['topics']]: diff --git a/lms/djangoapps/verify_student/admin.py b/lms/djangoapps/verify_student/admin.py index 278efdc177..0eb9644514 100644 --- a/lms/djangoapps/verify_student/admin.py +++ b/lms/djangoapps/verify_student/admin.py @@ -5,7 +5,7 @@ Admin site configurations for verify_student. from config_models.admin import ConfigurationModelAdmin from ratelimitbackend import admin -from verify_student.models import ( +from lms.djangoapps.verify_student.models import ( IcrvStatusEmailsConfiguration, SkippedReverification, SoftwareSecurePhotoVerification, diff --git a/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py b/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py index 6fdd1cc86f..2efdeadbde 100644 --- a/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py +++ b/lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py @@ -2,7 +2,7 @@ Django admin commands related to verify_student """ -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from django.core.management.base import BaseCommand diff --git a/lms/djangoapps/verify_student/management/commands/set_software_secure_status.py b/lms/djangoapps/verify_student/management/commands/set_software_secure_status.py index 9437b9da40..0be17a842d 100644 --- a/lms/djangoapps/verify_student/management/commands/set_software_secure_status.py +++ b/lms/djangoapps/verify_student/management/commands/set_software_secure_status.py @@ -5,7 +5,7 @@ Manually set Software Secure verification status. import sys from django.core.management.base import BaseCommand -from verify_student.models import ( +from lms.djangoapps.verify_student.models import ( SoftwareSecurePhotoVerification, VerificationCheckpoint, VerificationStatus ) @@ -19,7 +19,7 @@ class Command(BaseCommand): args = "<{approved, denied}, SoftwareSecurePhotoVerification id, [reason_for_denial]>" def handle(self, *args, **kwargs): # pylint: disable=unused-argument - from verify_student.views import _set_user_requirement_status + from lms.djangoapps.verify_student.views import _set_user_requirement_status status_to_set = args[0] receipt_id = args[1] diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py index 37099efc22..e8bf01d766 100644 --- a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py +++ b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py @@ -10,9 +10,9 @@ from django.test import TestCase from django.conf import settings from student.tests.factories import UserFactory -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from django.core.management import call_command -from verify_student.tests.test_models import ( +from lms.djangoapps.verify_student.tests.test_models import ( MockKey, MockS3Connection, mock_software_secure_post, mock_software_secure_post_error, FAKE_SETTINGS, ) @@ -20,9 +20,9 @@ from verify_student.tests.test_models import ( # Lots of patching to stub in our own settings, S3 substitutes, and HTTP posting @patch.dict(settings.VERIFY_STUDENT, FAKE_SETTINGS) -@patch('verify_student.models.S3Connection', new=MockS3Connection) -@patch('verify_student.models.Key', new=MockKey) -@patch('verify_student.models.requests.post', new=mock_software_secure_post) +@patch('lms.djangoapps.verify_student.models.S3Connection', new=MockS3Connection) +@patch('lms.djangoapps.verify_student.models.Key', new=MockKey) +@patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post) class TestVerifyStudentCommand(TestCase): """ Tests for django admin commands in the verify_student module @@ -48,9 +48,9 @@ class TestVerifyStudentCommand(TestCase): """ # set up some fake data to use... self.create_and_submit("SuccessfulSally") - with patch('verify_student.models.requests.post', new=mock_software_secure_post_error): + with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_error): self.create_and_submit("RetryRoger") - with patch('verify_student.models.requests.post', new=mock_software_secure_post_error): + with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_error): self.create_and_submit("RetryRick") # check to make sure we had two successes and two failures; otherwise we've got problems elsewhere assert_equals(len(SoftwareSecurePhotoVerification.objects.filter(status="submitted")), 1) diff --git a/lms/djangoapps/verify_student/migrations/0001_initial.py b/lms/djangoapps/verify_student/migrations/0001_initial.py index 31068d9dd5..ebc698cd64 100644 --- a/lms/djangoapps/verify_student/migrations/0001_initial.py +++ b/lms/djangoapps/verify_student/migrations/0001_initial.py @@ -1,96 +1,157 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import lms.djangoapps.verify_student.models +import model_utils.fields +import xmodule_django.models +import django.db.models.deletion +import django.utils.timezone +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'SoftwareSecurePhotoVerification' - db.create_table('verify_student_softwaresecurephotoverification', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('status', self.gf('model_utils.fields.StatusField')(default='created', max_length=100, no_check_for_status=True)), - ('status_changed', self.gf('model_utils.fields.MonitorField')(default=datetime.datetime.now, monitor=u'status')), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('face_image_url', self.gf('django.db.models.fields.URLField')(max_length=255, blank=True)), - ('photo_id_image_url', self.gf('django.db.models.fields.URLField')(max_length=255, blank=True)), - ('receipt_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), - ('submitted_at', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True)), - ('reviewing_user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='photo_verifications_reviewed', null=True, to=orm['auth.User'])), - ('reviewing_service', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('error_msg', self.gf('django.db.models.fields.TextField')(blank=True)), - ('error_code', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)), - ('photo_id_key', self.gf('django.db.models.fields.TextField')(max_length=1024)), - )) - db.send_create_signal('verify_student', ['SoftwareSecurePhotoVerification']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'SoftwareSecurePhotoVerification' - db.delete_table('verify_student_softwaresecurephotoverification') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] + operations = [ + migrations.CreateModel( + name='HistoricalVerificationDeadline', + fields=[ + ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_key', xmodule_django.models.CourseKeyField(help_text='The course for which this deadline applies', max_length=255, db_index=True)), + ('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')), + ('history_id', models.AutoField(serialize=False, primary_key=True)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), + ('history_user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + 'verbose_name': 'historical verification deadline', + }, + ), + migrations.CreateModel( + name='IcrvStatusEmailsConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='InCourseReverificationConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + migrations.CreateModel( + name='SkippedReverification', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name='SoftwareSecurePhotoVerification', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('status', model_utils.fields.StatusField(default=b'created', max_length=100, verbose_name='status', no_check_for_status=True, choices=[(b'created', b'created'), (b'ready', b'ready'), (b'submitted', b'submitted'), (b'must_retry', b'must_retry'), (b'approved', b'approved'), (b'denied', b'denied')])), + ('status_changed', model_utils.fields.MonitorField(default=django.utils.timezone.now, verbose_name='status changed', monitor='status')), + ('name', models.CharField(max_length=255, blank=True)), + ('face_image_url', models.URLField(max_length=255, blank=True)), + ('photo_id_image_url', models.URLField(max_length=255, blank=True)), + ('receipt_id', models.CharField(default=lms.djangoapps.verify_student.models.generateUUID, max_length=255, db_index=True)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('display', models.BooleanField(default=True, db_index=True)), + ('submitted_at', models.DateTimeField(null=True, db_index=True)), + ('reviewing_service', models.CharField(max_length=255, blank=True)), + ('error_msg', models.TextField(blank=True)), + ('error_code', models.CharField(max_length=50, blank=True)), + ('photo_id_key', models.TextField(max_length=1024)), + ('copy_id_photo_from', models.ForeignKey(blank=True, to='verify_student.SoftwareSecurePhotoVerification', null=True)), + ('reviewing_user', models.ForeignKey(related_name='photo_verifications_reviewed', default=None, to=settings.AUTH_USER_MODEL, null=True)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['-created_at'], + 'abstract': False, + }, + ), + migrations.CreateModel( + name='VerificationCheckpoint', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('checkpoint_location', models.CharField(max_length=255)), + ('photo_verification', models.ManyToManyField(to='verify_student.SoftwareSecurePhotoVerification')), + ], + ), + migrations.CreateModel( + name='VerificationDeadline', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_key', xmodule_django.models.CourseKeyField(help_text='The course for which this deadline applies', unique=True, max_length=255, db_index=True)), + ('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='VerificationStatus', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('status', models.CharField(db_index=True, max_length=32, choices=[(b'submitted', b'submitted'), (b'approved', b'approved'), (b'denied', b'denied'), (b'error', b'error')])), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ('response', models.TextField(null=True, blank=True)), + ('error', models.TextField(null=True, blank=True)), + ('checkpoint', models.ForeignKey(related_name='checkpoint_status', to='verify_student.VerificationCheckpoint')), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ], + options={ + 'get_latest_by': 'timestamp', + 'verbose_name': 'Verification Status', + 'verbose_name_plural': 'Verification Statuses', + }, + ), + migrations.AddField( + model_name='skippedreverification', + name='checkpoint', + field=models.ForeignKey(related_name='skipped_checkpoint', to='verify_student.VerificationCheckpoint'), + ), + migrations.AddField( + model_name='skippedreverification', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='verificationcheckpoint', + unique_together=set([('course_id', 'checkpoint_location')]), + ), + migrations.AlterUniqueTogether( + name='skippedreverification', + unique_together=set([('user', 'course_id')]), + ), + ] diff --git a/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py b/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py deleted file mode 100644 index 38ced7fe98..0000000000 --- a/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SoftwareSecurePhotoVerification.window' - db.add_column('verify_student_softwaresecurephotoverification', 'window', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['reverification.MidcourseReverificationWindow'], null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SoftwareSecurePhotoVerification.window' - db.delete_column('verify_student_softwaresecurephotoverification', 'window_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py b/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py deleted file mode 100644 index c91f7797a1..0000000000 --- a/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SoftwareSecurePhotoVerification.display' - db.add_column('verify_student_softwaresecurephotoverification', 'display', - self.gf('django.db.models.fields.BooleanField')(default=True, db_index=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SoftwareSecurePhotoVerification.display' - db.delete_column('verify_student_softwaresecurephotoverification', 'display') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0004_auto__add_verificationcheckpoint__add_unique_verificationcheckpoint_co.py b/lms/djangoapps/verify_student/migrations/0004_auto__add_verificationcheckpoint__add_unique_verificationcheckpoint_co.py deleted file mode 100644 index 41a8ed7403..0000000000 --- a/lms/djangoapps/verify_student/migrations/0004_auto__add_verificationcheckpoint__add_unique_verificationcheckpoint_co.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'VerificationCheckpoint' - db.create_table('verify_student_verificationcheckpoint', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('checkpoint_name', self.gf('django.db.models.fields.CharField')(max_length=32)), - )) - db.send_create_signal('verify_student', ['VerificationCheckpoint']) - - # Adding M2M table for field photo_verification on 'VerificationCheckpoint' - m2m_table_name = db.shorten_name('verify_student_verificationcheckpoint_photo_verification') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('verificationcheckpoint', models.ForeignKey(orm['verify_student.verificationcheckpoint'], null=False)), - ('softwaresecurephotoverification', models.ForeignKey(orm['verify_student.softwaresecurephotoverification'], null=False)) - )) - db.create_unique(m2m_table_name, ['verificationcheckpoint_id', 'softwaresecurephotoverification_id']) - - # Adding unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_name'] - db.create_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_name']) - - # Adding model 'VerificationStatus' - db.create_table('verify_student_verificationstatus', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('checkpoint', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['verify_student.VerificationCheckpoint'])), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('status', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('response', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('error', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('verify_student', ['VerificationStatus']) - - - def backwards(self, orm): - # Removing unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_name'] - db.delete_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_name']) - - # Deleting model 'VerificationCheckpoint' - db.delete_table('verify_student_verificationcheckpoint') - - # Removing M2M table for field photo_verification on 'VerificationCheckpoint' - db.delete_table(db.shorten_name('verify_student_verificationcheckpoint_photo_verification')) - - # Deleting model 'VerificationStatus' - db.delete_table('verify_student_verificationstatus') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'4f091843-1377-4d3b-af5d-3a4ae3d17943'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_name'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0005_auto__add_incoursereverificationconfiguration.py b/lms/djangoapps/verify_student/migrations/0005_auto__add_incoursereverificationconfiguration.py deleted file mode 100644 index dc1a653a0f..0000000000 --- a/lms/djangoapps/verify_student/migrations/0005_auto__add_incoursereverificationconfiguration.py +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'InCourseReverificationConfiguration' - db.create_table('verify_student_incoursereverificationconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('verify_student', ['InCourseReverificationConfiguration']) - - - def backwards(self, orm): - # Deleting model 'InCourseReverificationConfiguration' - db.delete_table('verify_student_incoursereverificationconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'8a3c9d8a-b885-480e-8e1e-ca111326db42'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_name'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0006_auto__add_skippedreverification__add_unique_skippedreverification_user.py b/lms/djangoapps/verify_student/migrations/0006_auto__add_skippedreverification__add_unique_skippedreverification_user.py deleted file mode 100644 index 46cb10c236..0000000000 --- a/lms/djangoapps/verify_student/migrations/0006_auto__add_skippedreverification__add_unique_skippedreverification_user.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'SkippedReverification' - db.create_table('verify_student_skippedreverification', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('checkpoint', self.gf('django.db.models.fields.related.ForeignKey')(related_name='skipped_checkpoint', to=orm['verify_student.VerificationCheckpoint'])), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - )) - db.send_create_signal('verify_student', ['SkippedReverification']) - - # Adding unique constraint on 'SkippedReverification', fields ['user', 'course_id'] - db.create_unique('verify_student_skippedreverification', ['user_id', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'SkippedReverification', fields ['user', 'course_id'] - db.delete_unique('verify_student_skippedreverification', ['user_id', 'course_id']) - - # Deleting model 'SkippedReverification' - db.delete_table('verify_student_skippedreverification') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'aaa24e01-3318-4707-a3ed-74d0f1c1ed15'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_name'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] \ No newline at end of file diff --git a/lms/djangoapps/verify_student/migrations/0007_auto__add_field_verificationstatus_location_id.py b/lms/djangoapps/verify_student/migrations/0007_auto__add_field_verificationstatus_location_id.py deleted file mode 100644 index e2a14fcaeb..0000000000 --- a/lms/djangoapps/verify_student/migrations/0007_auto__add_field_verificationstatus_location_id.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'VerificationStatus.location_id' - db.add_column('verify_student_verificationstatus', 'location_id', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'VerificationStatus.location_id' - db.delete_column('verify_student_verificationstatus', 'location_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'9997c000-3299-4097-a2cf-9ab35f9efdb5'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_name'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'location_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] \ No newline at end of file diff --git a/lms/djangoapps/verify_student/migrations/0008_auto__del_field_verificationcheckpoint_checkpoint_name__add_field_veri.py b/lms/djangoapps/verify_student/migrations/0008_auto__del_field_verificationcheckpoint_checkpoint_name__add_field_veri.py deleted file mode 100644 index 3ea1810b66..0000000000 --- a/lms/djangoapps/verify_student/migrations/0008_auto__del_field_verificationcheckpoint_checkpoint_name__add_field_veri.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_name'] - db.delete_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_name']) - - # Deleting field 'VerificationCheckpoint.checkpoint_name' - db.delete_column('verify_student_verificationcheckpoint', 'checkpoint_name') - - # Adding field 'VerificationCheckpoint.checkpoint_location' - db.add_column('verify_student_verificationcheckpoint', 'checkpoint_location', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - # Adding unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_location'] - db.create_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_location']) - - # Deleting field 'VerificationStatus.location_id' - db.delete_column('verify_student_verificationstatus', 'location_id') - - - def backwards(self, orm): - # Removing unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_location'] - db.delete_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_location']) - - - # User chose to not deal with backwards NULL issues for 'VerificationCheckpoint.checkpoint_name' - raise RuntimeError("Cannot reverse this migration. 'VerificationCheckpoint.checkpoint_name' and its values cannot be restored.") - - # The following code is provided here to aid in writing a correct migration # Adding field 'VerificationCheckpoint.checkpoint_name' - db.add_column('verify_student_verificationcheckpoint', 'checkpoint_name', - self.gf('django.db.models.fields.CharField')(max_length=32), - keep_default=False) - - # Deleting field 'VerificationCheckpoint.checkpoint_location' - db.delete_column('verify_student_verificationcheckpoint', 'checkpoint_location') - - # Adding unique constraint on 'VerificationCheckpoint', fields ['course_id', 'checkpoint_name'] - db.create_unique('verify_student_verificationcheckpoint', ['course_id', 'checkpoint_name']) - - # Adding field 'VerificationStatus.location_id' - db.add_column('verify_student_verificationstatus', 'location_id', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'4ae40fdd-c39a-4a23-a593-41beec90013b'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['reverification.MidcourseReverificationWindow']", 'null': 'True'}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] \ No newline at end of file diff --git a/lms/djangoapps/verify_student/migrations/0009_auto__change_softwaresecurephotoverification_window_id_default_none.py b/lms/djangoapps/verify_student/migrations/0009_auto__change_softwaresecurephotoverification_window_id_default_none.py deleted file mode 100644 index 9d5433196a..0000000000 --- a/lms/djangoapps/verify_student/migrations/0009_auto__change_softwaresecurephotoverification_window_id_default_none.py +++ /dev/null @@ -1,119 +0,0 @@ -# -*- coding: utf-8 -*- -from south.db import db -from south.v2 import SchemaMigration - - -class Migration(SchemaMigration): - - def forwards(self): - - # Changing field 'SoftwareSecurePhotoVerification.window'. Setting its default value to None - if db.backend_name == 'mysql': - db.execute('ALTER TABLE verify_student_softwaresecurephotoverification CHANGE `window_id` `window_id` int(11) DEFAULT NULL;') - - def backwards(self, orm): - - # Changing field 'SoftwareSecurePhotoVerification.window' - db.alter_column('verify_student_softwaresecurephotoverification', 'window_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['reverification.MidcourseReverificationWindow'])) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'reverification.midcoursereverificationwindow': { - 'Meta': {'object_name': 'MidcourseReverificationWindow'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'42ae367f-f6eb-456b-84c8-a3fd2baf4208'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'window': ('django.db.models.fields.related.ForeignKey', [], {'null': 'True', 'to': "orm['reverification.MidcourseReverificationWindow']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'null': 'True', 'to': "orm['verify_student.SoftwareSecurePhotoVerification']"}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] - diff --git a/lms/djangoapps/verify_student/migrations/0010_auto__del_field_softwaresecurephotoverification_window.py b/lms/djangoapps/verify_student/migrations/0010_auto__del_field_softwaresecurephotoverification_window.py deleted file mode 100644 index 7bd2ed7f60..0000000000 --- a/lms/djangoapps/verify_student/migrations/0010_auto__del_field_softwaresecurephotoverification_window.py +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - - def forwards(self, orm): - # Deleting field 'SoftwareSecurePhotoVerification.window' - db.delete_column('verify_student_softwaresecurephotoverification', 'window_id') - - - def backwards(self, orm): - # Add field 'SoftwareSecurePhotoVerification.window'. Setting its default value to None - if db.backend_name == 'mysql': - db.execute('ALTER TABLE verify_student_softwaresecurephotoverification ADD `window_id` int(11) DEFAULT NULL;') - else: - db.add_column('verify_student_softwaresecurephotoverification', 'window', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['reverification.MidcourseReverificationWindow'], null=True), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'c6b63663-5694-49b2-ae71-494b9afee0cf'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0011_add_verification_deadline.py b/lms/djangoapps/verify_student/migrations/0011_add_verification_deadline.py deleted file mode 100644 index 2718a7df49..0000000000 --- a/lms/djangoapps/verify_student/migrations/0011_add_verification_deadline.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'HistoricalVerificationDeadline' - db.create_table('verify_student_historicalverificationdeadline', ( - ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('deadline', self.gf('django.db.models.fields.DateTimeField')()), - (u'history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - (u'history_date', self.gf('django.db.models.fields.DateTimeField')()), - (u'history_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name=u'+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - (u'history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), - )) - db.send_create_signal('verify_student', ['HistoricalVerificationDeadline']) - - # Adding model 'VerificationDeadline' - db.create_table('verify_student_verificationdeadline', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), - ('deadline', self.gf('django.db.models.fields.DateTimeField')()), - )) - db.send_create_signal('verify_student', ['VerificationDeadline']) - - - def backwards(self, orm): - # Deleting model 'HistoricalVerificationDeadline' - db.delete_table('verify_student_historicalverificationdeadline') - - # Deleting model 'VerificationDeadline' - db.delete_table('verify_student_verificationdeadline') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.historicalverificationdeadline': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalVerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'9b14470c-4219-4c69-9a38-d8ff14b60b09'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationdeadline': { - 'Meta': {'object_name': 'VerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] \ No newline at end of file diff --git a/lms/djangoapps/verify_student/migrations/0012_populate_verification_deadlines.py b/lms/djangoapps/verify_student/migrations/0012_populate_verification_deadlines.py deleted file mode 100644 index eaafcee52a..0000000000 --- a/lms/djangoapps/verify_student/migrations/0012_populate_verification_deadlines.py +++ /dev/null @@ -1,180 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - - -class Migration(DataMigration): - - def forwards(self, orm): - """ - This migration populates the "verification deadline" model with - the "expiration datetime" from the course modes table for verified - courses. - - In the past, the course modes expiration (really an upgrade deadline) - and the verification deadline were always set to the same value. - With this change, the verification deadline will now be tracked in a separate - model owned by the verify_student app. - """ - - # Retrieve all verified course modes (whether they have expired or not) - # Unfortunately, we don't have access to constants from the application here, - # so we hard-code the names of the course modes that require verification. - verified_modes = orm['course_modes.CourseMode'].objects.filter( - mode_slug__in=["verified", "professional"], - expiration_datetime__isnull=False, - ) - - for mode in verified_modes: - orm.VerificationDeadline.objects.create( - course_key=mode.course_id, - deadline=mode.expiration_datetime, - ) - - def backwards(self, orm): - """ - Backwards migration deletes all verification deadlines. - """ - orm.VerificationDeadline.objects.all().delete() - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_modes.coursemode': { - 'Meta': {'unique_together': "(('course_id', 'mode_slug', 'currency'),)", 'object_name': 'CourseMode'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'sku': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - }, - 'course_modes.coursemodesarchive': { - 'Meta': {'object_name': 'CourseModesArchive'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'default': "'usd'", 'max_length': '8'}), - 'expiration_date': ('django.db.models.fields.DateField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'expiration_datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'min_price': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'mode_display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'mode_slug': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'suggested_prices': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}) - }, - 'verify_student.historicalverificationdeadline': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalVerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'6644e0c2-da9b-49a4-9d0c-c19c596c911e'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationdeadline': { - 'Meta': {'object_name': 'VerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['course_modes', 'verify_student'] - symmetrical = True diff --git a/lms/djangoapps/verify_student/migrations/0013_auto__add_field_softwaresecurephotoverification_copy_id_photo_from.py b/lms/djangoapps/verify_student/migrations/0013_auto__add_field_softwaresecurephotoverification_copy_id_photo_from.py deleted file mode 100644 index a81a2a9edf..0000000000 --- a/lms/djangoapps/verify_student/migrations/0013_auto__add_field_softwaresecurephotoverification_copy_id_photo_from.py +++ /dev/null @@ -1,134 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SoftwareSecurePhotoVerification.copy_id_photo_from' - db.add_column('verify_student_softwaresecurephotoverification', 'copy_id_photo_from', - self.gf('django.db.models.fields.related.ForeignKey')(to=orm['verify_student.SoftwareSecurePhotoVerification'], null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SoftwareSecurePhotoVerification.copy_id_photo_from' - db.delete_column('verify_student_softwaresecurephotoverification', 'copy_id_photo_from_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.historicalverificationdeadline': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalVerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'copy_id_photo_from': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'28d8227e-6c75-418a-b1ae-46b6b8e7557f'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationdeadline': { - 'Meta': {'object_name': 'VerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] \ No newline at end of file diff --git a/lms/djangoapps/verify_student/migrations/0014_set_copy_id_photo_from.py b/lms/djangoapps/verify_student/migrations/0014_set_copy_id_photo_from.py deleted file mode 100644 index 5955559f5a..0000000000 --- a/lms/djangoapps/verify_student/migrations/0014_set_copy_id_photo_from.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - - -class Migration(DataMigration): - - def forwards(self, orm): - """Add values for self referencing column 'copy_id_photo_from' in - table 'SoftwareSecurePhotoVerification'. - - Set the 'copy_id_photo_from' column value to initial verification which - has the photo ID key. - """ - verifications_without_photo_id = orm.SoftwareSecurePhotoVerification.objects.filter( - photo_id_key='' - ) - for verification in verifications_without_photo_id: - # Get the initial verification of the user with the 'photo_id_key' - to_copy = orm.SoftwareSecurePhotoVerification.objects.filter( - user=verification.user, - status__in=["submitted", "approved"] - ).exclude(photo_id_key='') - to_copy = to_copy.latest('created_at') if to_copy.exists() else None - - if to_copy: - verification.copy_id_photo_from = to_copy - verification.save() - - def backwards(self, orm): - "Write your backwards methods here." - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.historicalverificationdeadline': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalVerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'copy_id_photo_from': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'8b8c982c-9872-4f8f-a249-01369acf5110'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationdeadline': { - 'Meta': {'object_name': 'VerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] - symmetrical = True diff --git a/lms/djangoapps/verify_student/migrations/0015_auto__add_icrvstatusemailsconfiguration.py b/lms/djangoapps/verify_student/migrations/0015_auto__add_icrvstatusemailsconfiguration.py deleted file mode 100644 index a56841c864..0000000000 --- a/lms/djangoapps/verify_student/migrations/0015_auto__add_icrvstatusemailsconfiguration.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'IcrvStatusEmailsConfiguration' - db.create_table('verify_student_icrvstatusemailsconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('verify_student', ['IcrvStatusEmailsConfiguration']) - - - def backwards(self, orm): - # Deleting model 'IcrvStatusEmailsConfiguration' - db.delete_table('verify_student_icrvstatusemailsconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'verify_student.historicalverificationdeadline': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalVerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.icrvstatusemailsconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'IcrvStatusEmailsConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.incoursereverificationconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'InCourseReverificationConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'verify_student.skippedreverification': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'SkippedReverification'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'skipped_checkpoint'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.softwaresecurephotoverification': { - 'Meta': {'ordering': "['-created_at']", 'object_name': 'SoftwareSecurePhotoVerification'}, - 'copy_id_photo_from': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), - 'error_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), - 'error_msg': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'face_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_image_url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'}), - 'photo_id_key': ('django.db.models.fields.TextField', [], {'max_length': '1024'}), - 'receipt_id': ('django.db.models.fields.CharField', [], {'default': "'1dacd5f0-d7f0-452f-b2ed-6e2756547305'", 'max_length': '255', 'db_index': 'True'}), - 'reviewing_service': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'reviewing_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'photo_verifications_reviewed'", 'null': 'True', 'to': "orm['auth.User']"}), - 'status': ('model_utils.fields.StatusField', [], {'default': "'created'", 'max_length': '100', u'no_check_for_status': 'True'}), - 'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}), - 'submitted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'verify_student.verificationcheckpoint': { - 'Meta': {'unique_together': "(('course_id', 'checkpoint_location'),)", 'object_name': 'VerificationCheckpoint'}, - 'checkpoint_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'photo_verification': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['verify_student.SoftwareSecurePhotoVerification']", 'symmetrical': 'False'}) - }, - 'verify_student.verificationdeadline': { - 'Meta': {'object_name': 'VerificationDeadline'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}) - }, - 'verify_student.verificationstatus': { - 'Meta': {'object_name': 'VerificationStatus'}, - 'checkpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'checkpoint_status'", 'to': "orm['verify_student.VerificationCheckpoint']"}), - 'error': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index e3da4537fd..24a03c50e9 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -36,7 +36,7 @@ from config_models.models import ConfigurationModel from course_modes.models import CourseMode from model_utils.models import StatusModel, TimeStampedModel from model_utils import Choices -from verify_student.ssencrypt import ( +from lms.djangoapps.verify_student.ssencrypt import ( random_aes_key, encrypt_and_encode, generate_signed_message, rsa_encrypt ) @@ -150,7 +150,7 @@ class PhotoVerification(StatusModel): # user IDs or something too easily guessable. receipt_id = models.CharField( db_index=True, - default=lambda: generateUUID(), + default=generateUUID, max_length=255, ) @@ -189,6 +189,7 @@ class PhotoVerification(StatusModel): error_code = models.CharField(blank=True, max_length=50) class Meta(object): + app_label = "verify_student" abstract = True ordering = ['-created_at'] @@ -937,6 +938,8 @@ class VerificationDeadline(TimeStampedModel): then that course does not have a deadline. This means that users can submit photos at any time. """ + class Meta(object): + app_label = "verify_student" course_key = CourseKeyField( max_length=255, @@ -1047,6 +1050,7 @@ class VerificationCheckpoint(models.Model): photo_verification = models.ManyToManyField(SoftwareSecurePhotoVerification) class Meta(object): + app_label = "verify_student" unique_together = ('course_id', 'checkpoint_location') def __unicode__(self): @@ -1112,21 +1116,15 @@ class VerificationCheckpoint(models.Model): course_id (CourseKey): CourseKey checkpoint_location (str): Verification checkpoint location + Raises: + IntegrityError if create fails due to concurrent create. + Returns: VerificationCheckpoint object if exists otherwise None """ - try: + with transaction.atomic(): checkpoint, __ = cls.objects.get_or_create(course_id=course_id, checkpoint_location=checkpoint_location) return checkpoint - except IntegrityError: - log.info( - u"An integrity error occurred while getting-or-creating the verification checkpoint " - "for course %s at location %s. This can occur if two processes try to get-or-create " - "the checkpoint at the same time and the database is set to REPEATABLE READ. " - "We will try committing the transaction and retrying." - ) - transaction.commit() - return cls.objects.get(course_id=course_id, checkpoint_location=checkpoint_location) class VerificationStatus(models.Model): @@ -1156,6 +1154,7 @@ class VerificationStatus(models.Model): error = models.TextField(null=True, blank=True) class Meta(object): + app_label = "verify_student" get_latest_by = "timestamp" verbose_name = "Verification Status" verbose_name_plural = "Verification Statuses" @@ -1333,9 +1332,11 @@ class SkippedReverification(models.Model): created_at = models.DateTimeField(auto_now_add=True) class Meta(object): + app_label = "verify_student" unique_together = (('user', 'course_id'),) @classmethod + @transaction.atomic def add_skipped_reverification_attempt(cls, checkpoint, user_id, course_id): """Create skipped reverification object. diff --git a/lms/djangoapps/verify_student/services.py b/lms/djangoapps/verify_student/services.py index 0269d8ed3c..8caf7d5057 100644 --- a/lms/djangoapps/verify_student/services.py +++ b/lms/djangoapps/verify_student/services.py @@ -11,7 +11,7 @@ from django.db import IntegrityError from opaque_keys.edx.keys import CourseKey from student.models import User, CourseEnrollment -from verify_student.models import VerificationCheckpoint, VerificationStatus, SkippedReverification +from lms.djangoapps.verify_student.models import VerificationCheckpoint, VerificationStatus, SkippedReverification log = logging.getLogger(__name__) diff --git a/lms/djangoapps/verify_student/tests/factories.py b/lms/djangoapps/verify_student/tests/factories.py index eb7c96de88..9abe2be505 100644 --- a/lms/djangoapps/verify_student/tests/factories.py +++ b/lms/djangoapps/verify_student/tests/factories.py @@ -3,7 +3,7 @@ Factories related to student verification. """ from factory.django import DjangoModelFactory -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification class SoftwareSecurePhotoVerificationFactory(DjangoModelFactory): diff --git a/lms/djangoapps/verify_student/tests/fake_software_secure.py b/lms/djangoapps/verify_student/tests/fake_software_secure.py index a3de08b7b1..fab26690d2 100644 --- a/lms/djangoapps/verify_student/tests/fake_software_secure.py +++ b/lms/djangoapps/verify_student/tests/fake_software_secure.py @@ -9,7 +9,7 @@ from django.utils.decorators import method_decorator from django.views.generic.base import View from edxmako.shortcuts import render_to_response -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification class SoftwareSecureFakeView(View): diff --git a/lms/djangoapps/verify_student/tests/test_fake_software_secure.py b/lms/djangoapps/verify_student/tests/test_fake_software_secure.py index 3855ec31c6..8bb513d093 100644 --- a/lms/djangoapps/verify_student/tests/test_fake_software_secure.py +++ b/lms/djangoapps/verify_student/tests/test_fake_software_secure.py @@ -7,7 +7,7 @@ from django.test import TestCase from mock import patch from student.tests.factories import UserFactory from util.testing import UrlResetMixin -from verify_student.models import SoftwareSecurePhotoVerification +from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification class SoftwareSecureFakeViewTest(UrlResetMixin, TestCase): diff --git a/lms/djangoapps/verify_student/tests/test_models.py b/lms/djangoapps/verify_student/tests/test_models.py index f55d0256cc..7517e553d5 100644 --- a/lms/djangoapps/verify_student/tests/test_models.py +++ b/lms/djangoapps/verify_student/tests/test_models.py @@ -7,7 +7,7 @@ import requests.exceptions import pytz from django.conf import settings -from django.db.utils import IntegrityError +from django.db import IntegrityError from django.test import TestCase from mock import patch from nose.tools import assert_is_none, assert_equals, assert_raises, assert_true, assert_false # pylint: disable=no-name-in-module @@ -18,7 +18,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from opaque_keys.edx.keys import CourseKey -from verify_student.models import ( +from lms.djangoapps.verify_student.models import ( SoftwareSecurePhotoVerification, VerificationException, VerificationCheckpoint, VerificationStatus, SkippedReverification, @@ -128,9 +128,9 @@ def mock_software_secure_post_unavailable(url, headers=None, data=None, **kwargs # Lots of patching to stub in our own settings, S3 substitutes, and HTTP posting @patch.dict(settings.VERIFY_STUDENT, FAKE_SETTINGS) -@patch('verify_student.models.S3Connection', new=MockS3Connection) -@patch('verify_student.models.Key', new=MockKey) -@patch('verify_student.models.requests.post', new=mock_software_secure_post) +@patch('lms.djangoapps.verify_student.models.S3Connection', new=MockS3Connection) +@patch('lms.djangoapps.verify_student.models.Key', new=MockKey) +@patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post) @ddt.ddt class TestPhotoVerification(ModuleStoreTestCase): @@ -228,12 +228,12 @@ class TestPhotoVerification(ModuleStoreTestCase): assert_equals(attempt.status, "submitted") # We post, but Software Secure doesn't like what we send for some reason - with patch('verify_student.models.requests.post', new=mock_software_secure_post_error): + with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_error): attempt = self.create_and_submit() assert_equals(attempt.status, "must_retry") # We try to post, but run into an error (in this case a newtork connection error) - with patch('verify_student.models.requests.post', new=mock_software_secure_post_unavailable): + with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_unavailable): attempt = self.create_and_submit() assert_equals(attempt.status, "must_retry") @@ -482,7 +482,9 @@ class TestPhotoVerification(ModuleStoreTestCase): user = UserFactory.create() course = CourseFactory.create() - with patch('verify_student.models.SoftwareSecurePhotoVerification.user_is_verified') as mock_verification: + with patch( + 'lms.djangoapps.verify_student.models.SoftwareSecurePhotoVerification.user_is_verified' + ) as mock_verification: mock_verification.return_value = status @@ -571,19 +573,18 @@ class VerificationCheckpointTest(ModuleStoreTestCase): checkpoint_location=self.checkpoint_midterm, ) - # Simulate that the get-or-create operation raises an IntegrityError + # Simulate that the get-or-create operation raises an IntegrityError. # This can happen when two processes both try to get-or-create at the same time # when the database is set to REPEATABLE READ. + # To avoid IntegrityError situations when calling this method, set the view to + # use a READ COMMITTED transaction instead. with patch.object(VerificationCheckpoint.objects, "get_or_create") as mock_get_or_create: mock_get_or_create.side_effect = IntegrityError - checkpoint = VerificationCheckpoint.get_or_create_verification_checkpoint( - self.course.id, - self.checkpoint_midterm - ) - - # The checkpoint should be retrieved without error - self.assertEqual(checkpoint.course_id, self.course.id) - self.assertEqual(checkpoint.checkpoint_location, self.checkpoint_midterm) + with self.assertRaises(IntegrityError): + _ = VerificationCheckpoint.get_or_create_verification_checkpoint( + self.course.id, + self.checkpoint_midterm + ) def test_unique_together_constraint(self): """ diff --git a/lms/djangoapps/verify_student/tests/test_services.py b/lms/djangoapps/verify_student/tests/test_services.py index 5c5a8b9dc1..c2f8f9e42f 100644 --- a/lms/djangoapps/verify_student/tests/test_services.py +++ b/lms/djangoapps/verify_student/tests/test_services.py @@ -10,8 +10,8 @@ from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory from student.models import CourseEnrollment from student.tests.factories import UserFactory -from verify_student.models import VerificationCheckpoint, VerificationStatus, SkippedReverification -from verify_student.services import ReverificationService +from lms.djangoapps.verify_student.models import VerificationCheckpoint, VerificationStatus, SkippedReverification +from lms.djangoapps.verify_student.services import ReverificationService from openedx.core.djangoapps.credit.api import get_credit_requirement_status, set_credit_requirements from openedx.core.djangoapps.credit.models import CreditCourse diff --git a/lms/djangoapps/verify_student/tests/test_ssencrypt.py b/lms/djangoapps/verify_student/tests/test_ssencrypt.py index 073ee4a2dc..7a3b83ba5d 100644 --- a/lms/djangoapps/verify_student/tests/test_ssencrypt.py +++ b/lms/djangoapps/verify_student/tests/test_ssencrypt.py @@ -1,7 +1,7 @@ import base64 from nose.tools import assert_equals -from verify_student.ssencrypt import ( +from lms.djangoapps.verify_student.ssencrypt import ( aes_decrypt, aes_encrypt, encrypt_and_encode, decode_and_decrypt, rsa_decrypt, rsa_encrypt ) diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index 588690dd74..1638f7c30c 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -42,11 +42,11 @@ from student.tests.factories import UserFactory, CourseEnrollmentFactory from student.models import CourseEnrollment from util.date_utils import get_default_time_display from util.testing import UrlResetMixin -from verify_student.views import ( +from lms.djangoapps.verify_student.views import ( checkout_with_ecommerce_service, render_to_response, PayAndVerifyView, _compose_message_reverification_email ) -from verify_student.models import ( +from lms.djangoapps.verify_student.models import ( VerificationDeadline, SoftwareSecurePhotoVerification, VerificationCheckpoint, VerificationStatus, IcrvStatusEmailsConfiguration, @@ -1092,7 +1092,7 @@ class CheckoutTestMixin(object): self.assertEqual(data, {'foo': 'bar'}) -@patch('verify_student.views.checkout_with_shoppingcart', return_value=TEST_PAYMENT_DATA) +@patch('lms.djangoapps.verify_student.views.checkout_with_shoppingcart', return_value=TEST_PAYMENT_DATA) class TestCreateOrderShoppingCart(CheckoutTestMixin, ModuleStoreTestCase): """ Test view behavior when the shoppingcart is used. """ @@ -1106,7 +1106,7 @@ class TestCreateOrderShoppingCart(CheckoutTestMixin, ModuleStoreTestCase): @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) -@patch('verify_student.views.checkout_with_ecommerce_service', return_value=TEST_PAYMENT_DATA) +@patch('lms.djangoapps.verify_student.views.checkout_with_ecommerce_service', return_value=TEST_PAYMENT_DATA) class TestCreateOrderEcommerceService(CheckoutTestMixin, ModuleStoreTestCase): """ Test view behavior when the ecommerce service is used. """ @@ -1142,7 +1142,7 @@ class TestCheckoutWithEcommerceService(ModuleStoreTestCase): content_type="application/json", ) - with mock.patch('verify_student.views.audit_log') as mock_audit_log: + with mock.patch('lms.djangoapps.verify_student.views.audit_log') as mock_audit_log: # Call the function actual_payment_data = checkout_with_ecommerce_service( user, @@ -1551,7 +1551,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertIn('JSON should be dict', response.content) self.assertEqual(response.status_code, 400) - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_invalid_access_key(self): """ Test for invalid access key. @@ -1573,7 +1576,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertIn('Access key invalid', response.content) self.assertEqual(response.status_code, 400) - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_wrong_edx_id(self): """ Test for wrong id of Software secure verification attempt. @@ -1595,7 +1601,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertIn('edX ID Invalid-Id not found', response.content) self.assertEqual(response.status_code, 400) - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_pass_result(self): """ Test for verification passed. @@ -1617,7 +1626,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertEqual(attempt.status, u'approved') self.assertEquals(response.content, 'OK!') - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_fail_result(self): """ Test for failed verification. @@ -1642,7 +1654,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertEqual(attempt.error_msg, u'"Invalid photo"') self.assertEquals(response.content, 'OK!') - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_system_fail_result(self): """ Test for software secure result system failure. @@ -1665,7 +1680,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertEqual(attempt.error_msg, u'"Memory overflow"') self.assertEquals(response.content, 'OK!') - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_unknown_result(self): """ test for unknown software secure result @@ -1686,7 +1704,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): ) self.assertIn('Result Unknown not understood', response.content) - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_in_course_reverify_disabled(self): """ Test for verification passed. @@ -1712,7 +1733,10 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): user_status = VerificationStatus.objects.filter(user=self.user).count() self.assertEqual(user_status, 0) - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_pass_in_course_reverify_result(self): """ Test for verification passed. @@ -1773,8 +1797,11 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertEquals(response.content, 'OK!') self.assertEqual(len(mail.outbox), 0) - @mock.patch('verify_student.views._send_email') - @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature)) + @mock.patch('lms.djangoapps.verify_student.views._send_email') + @mock.patch( + 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', + mock.Mock(side_effect=mocked_has_valid_signature) + ) def test_reverification_on_callback(self, mock_send_email): """ Test software secure callback flow for re-verification. @@ -1966,7 +1993,7 @@ class TestInCourseReverifyView(ModuleStoreTestCase): CourseEnrollment.enroll(self.user, self.course_key, mode="verified") # mocking and patching for bi events - analytics_patcher = patch('verify_student.views.analytics') + analytics_patcher = patch('lms.djangoapps.verify_student.views.analytics') self.mock_tracker = analytics_patcher.start() self.addCleanup(analytics_patcher.stop) diff --git a/lms/djangoapps/verify_student/urls.py b/lms/djangoapps/verify_student/urls.py index a4244986b7..ec28a5fd85 100644 --- a/lms/djangoapps/verify_student/urls.py +++ b/lms/djangoapps/verify_student/urls.py @@ -3,7 +3,7 @@ from django.conf import settings from django.conf.urls import patterns, url -from verify_student import views +from lms.djangoapps.verify_student import views urlpatterns = patterns( @@ -111,7 +111,7 @@ urlpatterns = patterns( # Fake response page for incourse reverification ( software secure ) if settings.FEATURES.get('ENABLE_SOFTWARE_SECURE_FAKE'): - from verify_student.tests.fake_software_secure import SoftwareSecureFakeView + from lms.djangoapps.verify_student.tests.fake_software_secure import SoftwareSecureFakeView urlpatterns += patterns( 'verify_student.tests.fake_software_secure', url(r'^software-secure-fake-response', SoftwareSecureFakeView.as_view()), diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index 46d831d523..fcd45a52a3 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -14,6 +14,7 @@ from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.mail import send_mail from django.core.urlresolvers import reverse +from django.db import transaction from django.http import HttpResponse, HttpResponseBadRequest, Http404 from django.contrib.auth.models import User from django.shortcuts import redirect @@ -46,17 +47,18 @@ from shoppingcart.models import Order, CertificateItem from shoppingcart.processors import ( get_signed_purchase_params, get_purchase_endpoint ) -from verify_student.ssencrypt import has_valid_signature -from verify_student.models import ( +from lms.djangoapps.verify_student.ssencrypt import has_valid_signature +from lms.djangoapps.verify_student.models import ( VerificationDeadline, SoftwareSecurePhotoVerification, VerificationCheckpoint, VerificationStatus, IcrvStatusEmailsConfiguration, ) -from verify_student.image import decode_image_data, InvalidImageData +from lms.djangoapps.verify_student.image import decode_image_data, InvalidImageData from util.json_request import JsonResponse from util.date_utils import get_default_time_display +from util.db import outer_atomic from xmodule.modulestore.django import modulestore from django.contrib.staticfiles.storage import staticfiles_storage @@ -820,7 +822,12 @@ class SubmitPhotosView(View): End-point for submitting photos for verification. """ + @method_decorator(transaction.non_atomic_requests) + def dispatch(self, *args, **kwargs): # pylint: disable=missing-docstring + return super(SubmitPhotosView, self).dispatch(*args, **kwargs) + @method_decorator(login_required) + @method_decorator(outer_atomic(read_committed=True)) def post(self, request): """ Submit photos for verification. diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index 87bbbf3b0c..c598cb3bff 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -71,6 +71,7 @@ DATABASES = { 'OPTIONS': { 'timeout': 30, }, + 'ATOMIC_REQUESTS': True, } } diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 5e7fb5310d..92a629fe2f 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -44,7 +44,7 @@ CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else "" ################################ ALWAYS THE SAME ############################## DEBUG = False -TEMPLATE_DEBUG = False +DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = False EMAIL_BACKEND = 'django_ses.SESBackend' SESSION_ENGINE = 'django.contrib.sessions.backends.cache' @@ -74,11 +74,6 @@ BROKER_HEARTBEAT_CHECKRATE = 2 # Each worker should only fetch one message at a time CELERYD_PREFETCH_MULTIPLIER = 1 -# Skip djcelery migrations, since we don't use the database as the broker -SOUTH_MIGRATION_MODULES = { - 'djcelery': 'ignore', -} - # Rename the exchange and queues for each variant QUEUE_VARIANT = CONFIG_PREFIX.lower() @@ -170,8 +165,19 @@ REGISTRATION_EXTRA_FIELDS = ENV_TOKENS.get('REGISTRATION_EXTRA_FIELDS', REGISTRA EDXMKTG_LOGGED_IN_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_LOGGED_IN_COOKIE_NAME', EDXMKTG_LOGGED_IN_COOKIE_NAME) EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', EDXMKTG_USER_INFO_COOKIE_NAME) +ENV_FEATURES = ENV_TOKENS.get('FEATURES', ENV_TOKENS.get('MITX_FEATURES', {})) +for feature, value in ENV_FEATURES.items(): + FEATURES[feature] = value + CMS_BASE = ENV_TOKENS.get('CMS_BASE', 'studio.edx.org') +ALLOWED_HOSTS = [ + # TODO: bbeggs remove this before prod, temp fix to get load testing running + "*", + ENV_TOKENS.get('LMS_BASE'), + FEATURES['PREVIEW_LMS_BASE'], +] + # allow for environments to specify what cookie name our login subsystem should use # this is to fix a bug regarding simultaneous logins between edx.org and edge.edx.org which can # happen with some browsers (e.g. Firefox) @@ -431,6 +437,10 @@ FILE_UPLOAD_STORAGE_PREFIX = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_PREFIX', FILE_U # function in util/query.py, which is useful for very large database reads DATABASES = AUTH_TOKENS['DATABASES'] +# Enable automatic transaction management on all databases +for database_name in DATABASES: + DATABASES[database_name]['ATOMIC_REQUESTS'] = True + XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] # Get the MODULESTORE from auth.json, but if it doesn't exist, @@ -665,9 +675,9 @@ ECOMMERCE_API_TIMEOUT = ENV_TOKENS.get('ECOMMERCE_API_TIMEOUT', ECOMMERCE_API_TI ##### Custom Courses for EdX ##### if FEATURES.get('CUSTOM_COURSES_EDX'): - INSTALLED_APPS += ('ccx',) + INSTALLED_APPS += ('lms.djangoapps.ccx',) FIELD_OVERRIDE_PROVIDERS += ( - 'ccx.overrides.CustomCoursesForEdxOverrideProvider', + 'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider', ) CCX_MAX_STUDENTS_ALLOWED = ENV_TOKENS.get('CCX_MAX_STUDENTS_ALLOWED', CCX_MAX_STUDENTS_ALLOWED) diff --git a/lms/envs/common.py b/lms/envs/common.py index e12b9155bf..69763872c7 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -479,9 +479,9 @@ OAUTH_OIDC_USERINFO_HANDLERS = ( 'oauth2_handler.UserInfoHandler' ) -################################## EDX WEB ##################################### -# This is where we stick our compiled template files. Most of the app uses Mako -# templates +################################## TEMPLATE CONFIGURATION ##################################### +# Mako templating +# TODO: Move the Mako templating into a different engine in TEMPLATES below. import tempfile MAKO_MODULE_DIR = os.path.join(tempfile.gettempdir(), 'mako_lms') MAKO_TEMPLATES = {} @@ -490,42 +490,64 @@ MAKO_TEMPLATES['main'] = [PROJECT_ROOT / 'templates', COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates', COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates'] -# This is where Django Template lookup is defined. There are a few of these -# still left lying around. -TEMPLATE_DIRS = [ - PROJECT_ROOT / "templates", - COMMON_ROOT / 'templates', - COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates', - COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates', - COMMON_ROOT / 'static', # required to statically include common Underscore templates +# Django templating +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + # Don't look for template source files inside installed applications. + 'APP_DIRS': False, + # Instead, look for template source files in these dirs. + 'DIRS': [ + PROJECT_ROOT / "templates", + COMMON_ROOT / 'templates', + COMMON_ROOT / 'lib' / 'capa' / 'capa' / 'templates', + COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates', + COMMON_ROOT / 'static', # required to statically include common Underscore templates + ], + # Options specific to this backend. + 'OPTIONS': { + 'loaders': [ + 'edxmako.makoloader.MakoFilesystemLoader', + 'edxmako.makoloader.MakoAppDirectoriesLoader', + + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + + ], + 'context_processors': [ + 'django.template.context_processors.request', + 'django.template.context_processors.static', + 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.i18n', + 'django.contrib.auth.context_processors.auth', # this is required for admin + 'django.template.context_processors.csrf', + + # Added for django-wiki + 'django.template.context_processors.media', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + 'sekizai.context_processors.sekizai', + + # Hack to get required link URLs to password reset templates + 'edxmako.shortcuts.marketing_link_context_processor', + + # Allows the open edX footer to be leveraged in Django Templates. + 'edxmako.shortcuts.open_source_footer_context_processor', + + # Shoppingcart processor (detects if request.user has a cart) + 'shoppingcart.context_processor.user_has_cart_context_processor', + + # Allows the open edX footer to be leveraged in Django Templates. + 'edxmako.shortcuts.microsite_footer_context_processor', + ], + # Change 'debug' in your environment settings files - not here. + 'debug': False + } + } ] +DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0] -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'django.core.context_processors.static', - 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.i18n', - 'django.contrib.auth.context_processors.auth', # this is required for admin - 'django.core.context_processors.csrf', - - # Added for django-wiki - 'django.core.context_processors.media', - 'django.core.context_processors.tz', - 'django.contrib.messages.context_processors.messages', - 'sekizai.context_processors.sekizai', - - # Hack to get required link URLs to password reset templates - 'edxmako.shortcuts.marketing_link_context_processor', - - # Allows the open edX footer to be leveraged in Django Templates. - 'edxmako.shortcuts.open_source_footer_context_processor', - - # Shoppingcart processor (detects if request.user has a cart) - 'shoppingcart.context_processor.user_has_cart_context_processor', - - # Allows the open edX footer to be leveraged in Django Templates. - 'edxmako.shortcuts.microsite_footer_context_processor', -) +############################################################################################### # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = ( @@ -777,12 +799,12 @@ CODE_JAIL = { COURSES_WITH_UNSAFE_CODE = [] ############################### DJANGO BUILT-INS ############################### -# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here +# Change DEBUG in your environment settings files, not here DEBUG = False -TEMPLATE_DEBUG = False USE_TZ = True SESSION_COOKIE_SECURE = False SESSION_SAVE_EVERY_REQUEST = False +SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' # CMS base CMS_BASE = 'localhost:8001' @@ -1101,16 +1123,6 @@ simplefilter('ignore') ################################# Middleware ################################### -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'edxmako.makoloader.MakoFilesystemLoader', - 'edxmako.makoloader.MakoAppDirectoriesLoader', - - # 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - -) - MIDDLEWARE_CLASSES = ( 'request_cache.middleware.RequestCache', 'microsite_configuration.middleware.MicrositeMiddleware', @@ -1154,11 +1166,8 @@ MIDDLEWARE_CLASSES = ( # Detects user-requested locale from 'accept-language' header in http request. # Must be after DarkLangMiddleware. - # TODO: Re-import the Django version once we upgrade to Django 1.8 [PLAT-671] - # 'django.middleware.locale.LocaleMiddleware', - 'django_locale.middleware.LocaleMiddleware', + 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.transaction.TransactionMiddleware', # 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django_comment_client.utils.ViewNameMiddleware', @@ -1806,8 +1815,8 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', + 'django.contrib.staticfiles', 'djcelery', - 'south', # Common views 'openedx.core.djangoapps.common_views', @@ -1827,7 +1836,6 @@ INSTALLED_APPS = ( # For asset pipelining 'edxmako', 'pipeline', - 'django.contrib.staticfiles', 'static_replace', # Theming @@ -1840,7 +1848,7 @@ INSTALLED_APPS = ( 'static_template_view', 'staticbook', 'track', - 'eventtracking.django', + 'eventtracking.django.apps.EventTrackingConfig', 'util', 'certificates', 'dashboard', @@ -1865,6 +1873,8 @@ INSTALLED_APPS = ( 'provider.oauth2', 'oauth2_provider', + 'third_party_auth', + # We don't use this directly (since we use OAuth2), but we need to install it anyway. # When a user is deleted, Django queries all tables with a FK to the auth_user table, # and since django-rest-framework-oauth imports this, it will try to access tables @@ -1881,7 +1891,10 @@ INSTALLED_APPS = ( 'sekizai', #'wiki.plugins.attachments', 'wiki.plugins.links', - 'wiki.plugins.notifications', + # Notifications were enabled, but only 11 people used it in three years. It + # got tangled up during the Django 1.8 migration, so we are disabling it. + # See TNL-3783 for details. + #'wiki.plugins.notifications', 'course_wiki.plugins.markdownedx', # Foldit integration @@ -1925,7 +1938,7 @@ INSTALLED_APPS = ( 'enrollment', # Student Identity Verification - 'verify_student', + 'lms.djangoapps.verify_student', # Dark-launching languages 'dark_lang', @@ -1952,6 +1965,7 @@ INSTALLED_APPS = ( # edX Mobile API 'mobile_api', + 'social.apps.django_app.default', # Surveys 'survey', @@ -1979,7 +1993,7 @@ INSTALLED_APPS = ( 'openedx.core.djangoapps.credit', # Course teams - 'teams', + 'lms.djangoapps.teams', 'xblock_django', @@ -1988,8 +2002,15 @@ INSTALLED_APPS = ( # Self-paced course configuration 'openedx.core.djangoapps.self_paced', + + 'sorl.thumbnail', ) +# Migrations which are not in the standard module "migrations" +MIGRATION_MODULES = { + 'social.apps.django_app.default': 'social.apps.django_app.default.south_migrations' +} + ######################### CSRF ######################################### # Forwards-compatibility with Django 1.7 @@ -2001,6 +2022,7 @@ CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52 REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'openedx.core.lib.api.paginators.DefaultPagination', 'PAGE_SIZE': 10, + 'URL_FORMAT_OVERRIDE': None, } @@ -2226,10 +2248,6 @@ PASSWORD_COMPLEXITY = {"UPPER": 1, "LOWER": 1, "DIGITS": 1} PASSWORD_DICTIONARY_EDIT_DISTANCE_THRESHOLD = None PASSWORD_DICTIONARY = [] -##################### LinkedIn ##################### -INSTALLED_APPS += ('django_openid_auth',) - - ############################ ORA 2 ############################################ # By default, don't use a file prefix @@ -2657,6 +2675,9 @@ CREDIT_TASK_DEFAULT_RETRY_DELAY = 30 # to throttling. CREDIT_TASK_MAX_RETRIES = 5 +# Dummy secret key for dev/test +SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd' + # Secret keys shared with credit providers. # Used to digitally sign credit requests (us --> provider) # and validate responses (provider --> us). diff --git a/lms/envs/dev.py b/lms/envs/dev.py index f8b00de05e..951cfd38d3 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -59,6 +59,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ENV_ROOT / "db" / "edx.db", + 'ATOMIC_REQUESTS': True, } } @@ -206,9 +207,6 @@ FEATURES['AUTH_USE_OPENID'] = True FEATURES['AUTH_USE_OPENID_PROVIDER'] = True FEATURES['BYPASS_ACTIVATION_EMAIL_FOR_EXTAUTH'] = True -INSTALLED_APPS += ('external_auth',) -INSTALLED_APPS += ('django_openid_auth',) - OPENID_CREATE_USERS = False OPENID_UPDATE_DETAILS_FROM_SREG = True OPENID_SSO_SERVER_URL = 'https://www.google.com/accounts/o8/id' # TODO: accept more endpoints diff --git a/lms/envs/dev_with_worker.py b/lms/envs/dev_with_worker.py index fe151c291a..68eb1c9355 100644 --- a/lms/envs/dev_with_worker.py +++ b/lms/envs/dev_with_worker.py @@ -29,11 +29,5 @@ DJKOMBU_POLLING_INTERVAL = 1.0 # Disable transaction management because we are using a worker. Views # that request a task and wait for the result will deadlock otherwise. - -MIDDLEWARE_CLASSES = tuple( - c for c in MIDDLEWARE_CLASSES - if c != 'django.middleware.transaction.TransactionMiddleware') - -# Note: other alternatives for disabling transactions don't work in 1.4 -# https://code.djangoproject.com/ticket/2304 -# https://code.djangoproject.com/ticket/16039 +for database_name in DATABASES: + DATABASES[database_name]['ATOMIC_REQUESTS'] = False diff --git a/lms/envs/devplus.py b/lms/envs/devplus.py index 708e65fdc5..86800d8847 100644 --- a/lms/envs/devplus.py +++ b/lms/envs/devplus.py @@ -30,6 +30,7 @@ DATABASES = { 'PASSWORD': '', 'HOST': '127.0.0.1', 'PORT': '3306', + 'ATOMIC_REQUESTS': True, } } diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 5bdac8bac2..897768757b 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -12,7 +12,7 @@ MEDIA_ROOT = "/edx/var/edxapp/uploads" DEBUG = True USE_I18N = True -TEMPLATE_DEBUG = True +DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = True SITE_NAME = 'localhost:8000' PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'Devstack') # By default don't use a worker, execute tasks as if they were local functions @@ -162,7 +162,7 @@ FEATURES['CERTIFICATES_HTML_VIEW'] = True ########################## Course Discovery ####################### -from django.utils.translation import ugettext as _ +_ = lambda s: s LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': _('Language')} COURSE_DISCOVERY_MEANINGS = { 'org': { diff --git a/lms/envs/load_test.py b/lms/envs/load_test.py index d050b8b32f..3ebe44182c 100644 --- a/lms/envs/load_test.py +++ b/lms/envs/load_test.py @@ -13,5 +13,7 @@ EXCLUDE_CSRF = lambda elem: elem not in [ 'django.core.context_processors.csrf', 'django.middleware.csrf.CsrfViewMiddleware' ] -TEMPLATE_CONTEXT_PROCESSORS = filter(EXCLUDE_CSRF, TEMPLATE_CONTEXT_PROCESSORS) +DEFAULT_TEMPLATE_ENGINE['OPTIONS']['context_processors'] = filter( + EXCLUDE_CSRF, DEFAULT_TEMPLATE_ENGINE['OPTIONS']['context_processors'] +) MIDDLEWARE_CLASSES = filter(EXCLUDE_CSRF, MIDDLEWARE_CLASSES) diff --git a/lms/envs/static.py b/lms/envs/static.py index 674807e184..f0da488e75 100644 --- a/lms/envs/static.py +++ b/lms/envs/static.py @@ -26,6 +26,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ENV_ROOT / "db" / "edx.db", + 'ATOMIC_REQUESTS': True, } } diff --git a/lms/envs/test.py b/lms/envs/test.py index 91fe133dd9..e58a311fff 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -26,6 +26,11 @@ from warnings import filterwarnings, simplefilter from openedx.core.lib.tempdir import mkdtemp_clean +# This patch disabes the commit_on_success decorator during tests +# in TestCase subclasses. +from util.testing import patch_testcase +patch_testcase() + # Silence noisy logs to make troubleshooting easier when tests fail. import logging LOG_OVERRIDES = [ @@ -180,11 +185,16 @@ CONTENTSTORE = { DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': TEST_ROOT / 'db' / 'edx.db' + 'NAME': TEST_ROOT / 'db' / 'edx.db', + 'ATOMIC_REQUESTS': True, }, } +# This hack disables migrations during tests. We want to create tables directly from the models for speed. +# See https://groups.google.com/d/msg/django-developers/PWPj3etj3-U/kCl6pMsQYYoJ. +MIGRATION_MODULES = {app: "app.migrations_not_used_in_tests" for app in INSTALLED_APPS} + CACHES = { # This is the cache used for most things. # In staging/prod envs, the sessions also live here. @@ -499,8 +509,8 @@ FEATURES['ENABLE_EDXNOTES'] = True # Enable teams feature for tests. FEATURES['ENABLE_TEAMS'] = True -# Add milestones to Installed apps for testing -INSTALLED_APPS += ('milestones', 'openedx.core.djangoapps.call_stack_manager') +# Add apps to Installed apps for testing +INSTALLED_APPS += ('openedx.core.djangoapps.call_stack_manager',) # Enable courseware search for tests FEATURES['ENABLE_COURSEWARE_SEARCH'] = True @@ -516,7 +526,7 @@ FACEBOOK_APP_ID = "Test" FACEBOOK_API_VERSION = "v2.2" ######### custom courses ######### -INSTALLED_APPS += ('ccx',) +INSTALLED_APPS += ('lms.djangoapps.ccx',) FEATURES['CUSTOM_COURSES_EDX'] = True # Set dummy values for profile image settings. diff --git a/lms/envs/test_static_optimized.py b/lms/envs/test_static_optimized.py index 58dd303064..19eaa2814e 100644 --- a/lms/envs/test_static_optimized.py +++ b/lms/envs/test_static_optimized.py @@ -17,6 +17,7 @@ from .common import * # pylint: disable=wildcard-import, unused-wildcard-import DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', + 'ATOMIC_REQUESTS': True, }, } diff --git a/lms/envs/test_with_mysql.py b/lms/envs/test_with_mysql.py new file mode 100644 index 0000000000..36d3d04ec8 --- /dev/null +++ b/lms/envs/test_with_mysql.py @@ -0,0 +1,15 @@ +""" +Used when testing with MySQL. +""" +from .test import * # pylint: disable=wildcard-import +from .aws import * # pylint: disable=wildcard-import + +# Dummy secret key for dev +SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd' + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + + 'lms.djangoapps.verify_student', +) diff --git a/lms/envs/yaml_config.py b/lms/envs/yaml_config.py index 37284af051..fbb01afd86 100644 --- a/lms/envs/yaml_config.py +++ b/lms/envs/yaml_config.py @@ -121,11 +121,6 @@ BROKER_HEARTBEAT_CHECKRATE = 2 # Each worker should only fetch one message at a time CELERYD_PREFETCH_MULTIPLIER = 1 -# Skip djcelery migrations, since we don't use the database as the broker -SOUTH_MIGRATION_MODULES = { - 'djcelery': 'ignore', -} - # Rename the exchange and queues for each variant QUEUE_VARIANT = CONFIG_PREFIX.lower() @@ -303,9 +298,9 @@ GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE ##### Custom Courses for EdX ##### if FEATURES.get('CUSTOM_COURSES_EDX'): - INSTALLED_APPS += ('ccx',) + INSTALLED_APPS += ('lms.djangoapps.ccx',) FIELD_OVERRIDE_PROVIDERS += ( - 'ccx.overrides.CustomCoursesForEdxOverrideProvider', + 'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider', ) ##### Individual Due Date Extensions ##### diff --git a/lms/startup.py b/lms/startup.py index 92ea5e0190..15a36615bb 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -4,6 +4,7 @@ Module for code that should run during LMS startup # pylint: disable=unused-argument +import django from django.conf import settings # Force settings to run so that the python path is modified @@ -12,8 +13,8 @@ settings.INSTALLED_APPS # pylint: disable=pointless-statement from openedx.core.lib.django_startup import autostartup import edxmako import logging -from monkey_patch import django_utils_translation import analytics +from monkey_patch import third_party_auth import xmodule.x_module @@ -26,7 +27,13 @@ def run(): """ Executed during django startup """ - django_utils_translation.patch() + third_party_auth.patch() + + # To override the settings before executing the autostartup() for python-social-auth + if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False): + enable_third_party_auth() + + django.setup() autostartup() @@ -38,9 +45,6 @@ def run(): if settings.FEATURES.get('USE_MICROSITES', False): enable_microsites() - if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False): - enable_third_party_auth() - # Initialize Segment analytics module by setting the write_key. if settings.LMS_SEGMENT_KEY: analytics.write_key = settings.LMS_SEGMENT_KEY @@ -101,7 +105,7 @@ def enable_stanford_theme(): theme_root = settings.ENV_ROOT / "themes" / settings.THEME_NAME # Include the theme's templates in the template search paths - settings.TEMPLATE_DIRS.insert(0, theme_root / 'templates') + settings.DEFAULT_TEMPLATE_ENGINE['DIRS'].insert(0, theme_root / 'templates') edxmako.paths.add_lookup('main', theme_root / 'templates', prepend=True) # Namespace the theme's static files to 'themes/' to @@ -149,7 +153,7 @@ def enable_microsites(): # if we have any valid microsites defined, let's wire in the Mako and STATIC_FILES search paths if microsite_config_dict: - settings.TEMPLATE_DIRS.append(microsites_root) + settings.DEFAULT_TEMPLATE_ENGINE['DIRS'].append(microsites_root) edxmako.paths.add_lookup('main', microsites_root) settings.STATICFILES_DIRS.insert(0, microsites_root) diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index 1fb2af233a..fcc3ae0431 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -7,7 +7,7 @@ from django.utils.translation import ugettext as _ from microsite_configuration import microsite from microsite_configuration.templatetags.microsite import platform_name -from ccx.overrides import get_current_ccx +from lms.djangoapps.ccx.overrides import get_current_ccx # App that handles subdomain specific branding import branding diff --git a/lms/templates/verify_student/missed_deadline.html b/lms/templates/verify_student/missed_deadline.html index 26192f2fd5..05be906911 100644 --- a/lms/templates/verify_student/missed_deadline.html +++ b/lms/templates/verify_student/missed_deadline.html @@ -1,6 +1,6 @@ <%! from django.utils.translation import ugettext as _ -from verify_student.views import PayAndVerifyView +from lms.djangoapps.verify_student.views import PayAndVerifyView %> <%namespace name='static' file='../static_content.html'/> diff --git a/lms/templates/verify_student/pay_and_verify.html b/lms/templates/verify_student/pay_and_verify.html index 6c629296cf..d439909323 100644 --- a/lms/templates/verify_student/pay_and_verify.html +++ b/lms/templates/verify_student/pay_and_verify.html @@ -1,7 +1,7 @@ <%! import json from django.utils.translation import ugettext as _ -from verify_student.views import PayAndVerifyView +from lms.djangoapps.verify_student.views import PayAndVerifyView %> <%namespace name='static' file='../static_content.html'/> diff --git a/lms/urls.py b/lms/urls.py index d360848c73..84f48ee65f 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -4,6 +4,7 @@ URLs for LMS from django.conf import settings from django.conf.urls import patterns, include, url +from django.views.generic.base import RedirectView from ratelimitbackend import admin from django.conf.urls.static import static @@ -50,17 +51,17 @@ urlpatterns = ( url(r'^password_reset/$', 'student.views.password_reset', name='password_reset'), ## Obsolete Django views for password resets ## TODO: Replace with Mako-ized views - url(r'^password_change/$', django.contrib.auth.views.password_change, - name='auth_password_change'), - url(r'^password_change_done/$', django.contrib.auth.views.password_change_done, - name='auth_password_change_done'), + url(r'^password_change/$', 'django.contrib.auth.views.password_change', + name='password_change'), + url(r'^password_change_done/$', 'django.contrib.auth.views.password_change_done', + name='password_change_done'), url(r'^password_reset_confirm/(?P[0-9A-Za-z]+)-(?P.+)/$', 'student.views.password_reset_confirm_wrapper', - name='auth_password_reset_confirm'), - url(r'^password_reset_complete/$', django.contrib.auth.views.password_reset_complete, - name='auth_password_reset_complete'), - url(r'^password_reset_done/$', django.contrib.auth.views.password_reset_done, - name='auth_password_reset_done'), + name='password_reset_confirm'), + url(r'^password_reset_complete/$', 'django.contrib.auth.views.password_reset_complete', + name='password_reset_complete'), + url(r'^password_reset_done/$', 'django.contrib.auth.views.password_reset_done', + name='password_reset_done'), url(r'^heartbeat$', include('heartbeat.urls')), @@ -162,10 +163,9 @@ urlpatterns += ( # Favicon favicon_path = microsite.get_value('favicon_path', settings.FAVICON_PATH) -urlpatterns += (( +urlpatterns += (url( r'^favicon\.ico$', - 'django.views.generic.simple.redirect_to', - {'url': settings.STATIC_URL + favicon_path} + RedirectView.as_view(url=settings.STATIC_URL + favicon_path, permanent=True) ),) # Semi-static views only used by edX, not by themes @@ -496,8 +496,9 @@ if settings.COURSEWARE_ENABLED: if settings.FEATURES["ENABLE_TEAMS"]: # Teams endpoints urlpatterns += ( - url(r'^api/team/', include('teams.api_urls')), - url(r'^courses/{}/teams'.format(settings.COURSE_ID_PATTERN), include('teams.urls'), name="teams_endpoints"), + url(r'^api/team/', include('lms.djangoapps.teams.api_urls')), + url(r'^courses/{}/teams'.format(settings.COURSE_ID_PATTERN), + include('lms.djangoapps.teams.urls'), name="teams_endpoints"), ) # allow course staff to change to student view of courseware diff --git a/openedx/core/djangoapps/call_stack_manager/core.py b/openedx/core/djangoapps/call_stack_manager/core.py index 968ea1e440..099c8311ac 100644 --- a/openedx/core/djangoapps/call_stack_manager/core.py +++ b/openedx/core/djangoapps/call_stack_manager/core.py @@ -136,12 +136,12 @@ class CallStackMixin(object): return super(CallStackMixin, self).delete(*args, **kwargs) -class CallStackManager(Manager): +class CallStackManager(Manager): # pylint: disable=super-on-old-class """ Manager class which overrides the default Manager class for getting call stacks """ - def get_query_set(self): + def get_queryset(self): """ Override the default queryset API method """ capture_call_stack(self.model) - return super(CallStackManager, self).get_query_set() + return super(CallStackManager, self).get_queryset() def donottrack(*entities_not_to_be_tracked): diff --git a/openedx/core/djangoapps/common_views/xblock.py b/openedx/core/djangoapps/common_views/xblock.py index e800bf2432..85b45f25c6 100644 --- a/openedx/core/djangoapps/common_views/xblock.py +++ b/openedx/core/djangoapps/common_views/xblock.py @@ -37,4 +37,4 @@ def xblock_resource(request, block_type, uri): # pylint: disable=unused-argumen raise Http404 mimetype, _ = mimetypes.guess_type(uri) - return HttpResponse(content, mimetype=mimetype) + return HttpResponse(content, content_type=mimetype) diff --git a/openedx/core/djangoapps/content/course_overviews/__init__.py b/openedx/core/djangoapps/content/course_overviews/__init__.py index c5bcc278aa..a0d7bf38ac 100644 --- a/openedx/core/djangoapps/content/course_overviews/__init__.py +++ b/openedx/core/djangoapps/content/course_overviews/__init__.py @@ -22,7 +22,3 @@ with the appropriate course key. The use cases for this app include things like a user enrollment dashboard, a course metadata API, or a course marketing page. """ - -# importing signals is necessary to activate signal handler, which invalidates -# the CourseOverview cache every time a course is published -import openedx.core.djangoapps.content.course_overviews.signals # pylint: disable=unused-import diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py b/openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py index 7c69d3cd92..aa310bcc9a 100644 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py +++ b/openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py @@ -1,70 +1,60 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import model_utils.fields +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseOverview' - db.create_table('course_overviews_courseoverview', ( - ('id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, primary_key=True, db_index=True)), - ('_location', self.gf('xmodule_django.models.UsageKeyField')(max_length=255)), - ('display_name', self.gf('django.db.models.fields.TextField')(null=True)), - ('display_number_with_default', self.gf('django.db.models.fields.TextField')()), - ('display_org_with_default', self.gf('django.db.models.fields.TextField')()), - ('start', self.gf('django.db.models.fields.DateTimeField')(null=True)), - ('end', self.gf('django.db.models.fields.DateTimeField')(null=True)), - ('advertised_start', self.gf('django.db.models.fields.TextField')(null=True)), - ('course_image_url', self.gf('django.db.models.fields.TextField')()), - ('facebook_url', self.gf('django.db.models.fields.TextField')(null=True)), - ('social_sharing_url', self.gf('django.db.models.fields.TextField')(null=True)), - ('end_of_course_survey_url', self.gf('django.db.models.fields.TextField')(null=True)), - ('certificates_display_behavior', self.gf('django.db.models.fields.TextField')(null=True)), - ('certificates_show_before_end', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('has_any_active_web_certificate', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('cert_name_short', self.gf('django.db.models.fields.TextField')()), - ('cert_name_long', self.gf('django.db.models.fields.TextField')()), - ('lowest_passing_grade', self.gf('django.db.models.fields.DecimalField')(max_digits=5, decimal_places=2)), - ('mobile_available', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('visible_to_staff_only', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('_pre_requisite_courses_json', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('course_overviews', ['CourseOverview']) + dependencies = [ + ] - - def backwards(self, orm): - # Deleting model 'CourseOverview' - db.delete_table('course_overviews_courseoverview') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='CourseOverview', + fields=[ + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('version', models.IntegerField()), + ('id', xmodule_django.models.CourseKeyField(max_length=255, serialize=False, primary_key=True, db_index=True)), + ('_location', xmodule_django.models.UsageKeyField(max_length=255)), + ('display_name', models.TextField(null=True)), + ('display_number_with_default', models.TextField()), + ('display_org_with_default', models.TextField()), + ('start', models.DateTimeField(null=True)), + ('end', models.DateTimeField(null=True)), + ('advertised_start', models.TextField(null=True)), + ('course_image_url', models.TextField()), + ('facebook_url', models.TextField(null=True)), + ('social_sharing_url', models.TextField(null=True)), + ('end_of_course_survey_url', models.TextField(null=True)), + ('certificates_display_behavior', models.TextField(null=True)), + ('certificates_show_before_end', models.BooleanField(default=False)), + ('cert_html_view_enabled', models.BooleanField(default=False)), + ('has_any_active_web_certificate', models.BooleanField(default=False)), + ('cert_name_short', models.TextField()), + ('cert_name_long', models.TextField()), + ('lowest_passing_grade', models.DecimalField(null=True, max_digits=5, decimal_places=2)), + ('days_early_for_beta', models.FloatField(null=True)), + ('mobile_available', models.BooleanField(default=False)), + ('visible_to_staff_only', models.BooleanField(default=False)), + ('_pre_requisite_courses_json', models.TextField()), + ('enrollment_start', models.DateTimeField(null=True)), + ('enrollment_end', models.DateTimeField(null=True)), + ('enrollment_domain', models.TextField(null=True)), + ('invitation_only', models.BooleanField(default=False)), + ('max_student_enrollments_allowed', models.IntegerField(null=True)), + ], + ), + migrations.CreateModel( + name='CourseOverviewTab', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('tab_id', models.CharField(max_length=50)), + ('course_overview', models.ForeignKey(related_name='tabs', to='course_overviews.CourseOverview')), + ], + ), + ] diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0002_add_days_early_for_beta.py b/openedx/core/djangoapps/content/course_overviews/migrations/0002_add_days_early_for_beta.py deleted file mode 100644 index 341315b38e..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0002_add_days_early_for_beta.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseOverview.days_early_for_beta' - - # The default value for the days_early_for_beta column is null. However, - # for courses already in the table that have a non-null value for - # days_early_for_beta, this would be invalid. So, we must clear the - # table before adding the new column. - - db.clear_table('course_overviews_courseoverview') - db.add_column('course_overviews_courseoverview', 'days_early_for_beta', - self.gf('django.db.models.fields.FloatField')(null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseOverview.days_early_for_beta' - db.delete_column('course_overviews_courseoverview', 'days_early_for_beta') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0003_add_cert_html_view_enabled.py b/openedx/core/djangoapps/content/course_overviews/migrations/0003_add_cert_html_view_enabled.py deleted file mode 100644 index 3e15236786..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0003_add_cert_html_view_enabled.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseOverview.cert_html_view_enabled' - - # The default value for the cert_html_view_eanbled column is False. - # However, for courses in the table for which cert_html_view_enabled - # should be True, this would be invalid. So, we must clear the - # table before adding the new column. - - db.clear_table('course_overviews_courseoverview') - db.add_column('course_overviews_courseoverview', 'cert_html_view_enabled', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseOverview.cert_html_view_enabled' - db.delete_column('course_overviews_courseoverview', 'cert_html_view_enabled') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0004_default_lowest_passing_grade_to_None.py b/openedx/core/djangoapps/content/course_overviews/migrations/0004_default_lowest_passing_grade_to_None.py deleted file mode 100644 index 0876dbe747..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0004_default_lowest_passing_grade_to_None.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'CourseOverview.lowest_passing_grade' - db.alter_column('course_overviews_courseoverview', 'lowest_passing_grade', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=5, decimal_places=2)) - - def backwards(self, orm): - - # Changing field 'CourseOverview.lowest_passing_grade' - db.alter_column('course_overviews_courseoverview', 'lowest_passing_grade', self.gf('django.db.models.fields.DecimalField')(default=0.5, max_digits=5, decimal_places=2)) - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0005_add_enrollment_fields.py b/openedx/core/djangoapps/content/course_overviews/migrations/0005_add_enrollment_fields.py deleted file mode 100644 index 25c94e240a..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0005_add_enrollment_fields.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # The default values for these new columns may not match the actual - # values of courses already present in the table. To ensure that the - # cached values are correct, we must clear the table before adding any - # new columns. - db.clear_table('course_overviews_courseoverview') - - # Adding field 'CourseOverview.enrollment_start' - db.add_column('course_overviews_courseoverview', 'enrollment_start', - self.gf('django.db.models.fields.DateTimeField')(null=True), - keep_default=False) - - # Adding field 'CourseOverview.enrollment_end' - db.add_column('course_overviews_courseoverview', 'enrollment_end', - self.gf('django.db.models.fields.DateTimeField')(null=True), - keep_default=False) - - # Adding field 'CourseOverview.enrollment_domain' - db.add_column('course_overviews_courseoverview', 'enrollment_domain', - self.gf('django.db.models.fields.TextField')(null=True), - keep_default=False) - - # Adding field 'CourseOverview.invitation_only' - db.add_column('course_overviews_courseoverview', 'invitation_only', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - # Adding field 'CourseOverview.max_student_enrollments_allowed' - db.add_column('course_overviews_courseoverview', 'max_student_enrollments_allowed', - self.gf('django.db.models.fields.IntegerField')(null=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseOverview.enrollment_start' - db.delete_column('course_overviews_courseoverview', 'enrollment_start') - - # Deleting field 'CourseOverview.enrollment_end' - db.delete_column('course_overviews_courseoverview', 'enrollment_end') - - # Deleting field 'CourseOverview.enrollment_domain' - db.delete_column('course_overviews_courseoverview', 'enrollment_domain') - - # Deleting field 'CourseOverview.invitation_only' - db.delete_column('course_overviews_courseoverview', 'invitation_only') - - # Deleting field 'CourseOverview.max_student_enrollments_allowed' - db.delete_column('course_overviews_courseoverview', 'max_student_enrollments_allowed') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_domain': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'enrollment_start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'invitation_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2', 'null': 'True'}), - 'max_student_enrollments_allowed': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0006_add_version_and_timestamp.py b/openedx/core/djangoapps/content/course_overviews/migrations/0006_add_version_and_timestamp.py deleted file mode 100644 index 0cf8b31716..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0006_add_version_and_timestamp.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseOverview.created' - db.add_column('course_overviews_courseoverview', 'created', - self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), - keep_default=False) - - # Adding field 'CourseOverview.modified' - db.add_column('course_overviews_courseoverview', 'modified', - self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now), - keep_default=False) - - # Adding field 'CourseOverview.version' - db.add_column('course_overviews_courseoverview', 'version', - self.gf('django.db.models.fields.IntegerField')(default=0), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseOverview.created' - db.delete_column('course_overviews_courseoverview', 'created') - - # Deleting field 'CourseOverview.modified' - db.delete_column('course_overviews_courseoverview', 'modified') - - # Deleting field 'CourseOverview.version' - db.delete_column('course_overviews_courseoverview', 'version') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_domain': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'enrollment_start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'invitation_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2'}), - 'max_student_enrollments_allowed': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'version': ('django.db.models.fields.IntegerField', [], {}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0007_auto__add_courseoverviewtab.py b/openedx/core/djangoapps/content/course_overviews/migrations/0007_auto__add_courseoverviewtab.py deleted file mode 100644 index 70f4ca08c0..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0007_auto__add_courseoverviewtab.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseOverviewTab' - db.create_table('course_overviews_courseoverviewtab', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('tab_id', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('course_overview', self.gf('django.db.models.fields.related.ForeignKey')(related_name='tabs', to=orm['course_overviews.CourseOverview'])), - )) - db.send_create_signal('course_overviews', ['CourseOverviewTab']) - - - def backwards(self, orm): - # Deleting model 'CourseOverviewTab' - db.delete_table('course_overviews_courseoverviewtab') - - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_domain': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'enrollment_start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'invitation_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2'}), - 'max_student_enrollments_allowed': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'version': ('django.db.models.fields.IntegerField', [], {}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_overviews.courseoverviewtab': { - 'Meta': {'object_name': 'CourseOverviewTab'}, - 'course_overview': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tabs'", 'to': "orm['course_overviews.CourseOverview']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tab_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0008_drop_course_tabs_fk_constraint.py b/openedx/core/djangoapps/content/course_overviews/migrations/0008_drop_course_tabs_fk_constraint.py deleted file mode 100644 index 2adbc9ad67..0000000000 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0008_drop_course_tabs_fk_constraint.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Foreign keys aren't enforced by default on our version of SQLite3, and - # trying to delete them will throw an error. See: - # http://south.aeracode.org/ticket/775 - if db.backend_name != 'sqlite3': - db.delete_foreign_key('course_overviews_courseoverviewtab', 'course_overview_id') - - def backwards(self, orm): - pass - - models = { - 'course_overviews.courseoverview': { - 'Meta': {'object_name': 'CourseOverview'}, - '_location': ('xmodule_django.models.UsageKeyField', [], {'max_length': '255'}), - '_pre_requisite_courses_json': ('django.db.models.fields.TextField', [], {}), - 'advertised_start': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'cert_html_view_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'cert_name_long': ('django.db.models.fields.TextField', [], {}), - 'cert_name_short': ('django.db.models.fields.TextField', [], {}), - 'certificates_display_behavior': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'certificates_show_before_end': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'course_image_url': ('django.db.models.fields.TextField', [], {}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'days_early_for_beta': ('django.db.models.fields.FloatField', [], {'null': 'True'}), - 'display_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'display_number_with_default': ('django.db.models.fields.TextField', [], {}), - 'display_org_with_default': ('django.db.models.fields.TextField', [], {}), - 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'end_of_course_survey_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_domain': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'enrollment_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'enrollment_start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'facebook_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'has_any_active_web_certificate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'primary_key': 'True', 'db_index': 'True'}), - 'invitation_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'lowest_passing_grade': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2'}), - 'max_student_enrollments_allowed': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'mobile_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'social_sharing_url': ('django.db.models.fields.TextField', [], {'null': 'True'}), - 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), - 'version': ('django.db.models.fields.IntegerField', [], {}), - 'visible_to_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_overviews.courseoverviewtab': { - 'Meta': {'object_name': 'CourseOverviewTab'}, - 'course_overview': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tabs'", 'to': "orm['course_overviews.CourseOverview']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tab_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - } - } - - complete_apps = ['course_overviews'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_overviews/models.py b/openedx/core/djangoapps/content/course_overviews/models.py index 158f86fb91..68bd278e65 100644 --- a/openedx/core/djangoapps/content/course_overviews/models.py +++ b/openedx/core/djangoapps/content/course_overviews/models.py @@ -2,7 +2,7 @@ Declaration of CourseOverview model """ import json -from django.db import models +from django.db import models, transaction from django.db.models.fields import BooleanField, DateTimeField, DecimalField, TextField, FloatField, IntegerField from django.db.utils import IntegrityError @@ -31,6 +31,9 @@ class CourseOverview(TimeStampedModel): a course as part of a user dashboard or enrollment API. """ + class Meta(object): + app_label = 'course_overviews' + # IMPORTANT: Bump this whenever you modify this model and/or add a migration. VERSION = 2 @@ -57,9 +60,9 @@ class CourseOverview(TimeStampedModel): # Certification data certificates_display_behavior = TextField(null=True) - certificates_show_before_end = BooleanField() - cert_html_view_enabled = BooleanField() - has_any_active_web_certificate = BooleanField() + certificates_show_before_end = BooleanField(default=False) + cert_html_view_enabled = BooleanField(default=False) + has_any_active_web_certificate = BooleanField(default=False) cert_name_short = TextField() cert_name_long = TextField() @@ -68,8 +71,8 @@ class CourseOverview(TimeStampedModel): # Access parameters days_early_for_beta = FloatField(null=True) - mobile_available = BooleanField() - visible_to_staff_only = BooleanField() + mobile_available = BooleanField(default=False) + visible_to_staff_only = BooleanField(default=False) _pre_requisite_courses_json = TextField() # JSON representation of list of CourseKey strings # Enrollment details @@ -111,7 +114,7 @@ class CourseOverview(TimeStampedModel): end = course.end max_student_enrollments_allowed = course.max_student_enrollments_allowed if isinstance(course.id, CCXLocator): - from ccx.utils import get_ccx_from_ccx_locator # pylint: disable=import-error + from lms.djangoapps.ccx.utils import get_ccx_from_ccx_locator ccx = get_ccx_from_ccx_locator(course.id) display_name = ccx.display_name start = ccx.start @@ -179,11 +182,12 @@ class CourseOverview(TimeStampedModel): if isinstance(course, CourseDescriptor): course_overview = cls._create_from_course(course) try: - course_overview.save() - CourseOverviewTab.objects.bulk_create([ - CourseOverviewTab(tab_id=tab.tab_id, course_overview=course_overview) - for tab in course.tabs - ]) + with transaction.atomic(): + course_overview.save() + CourseOverviewTab.objects.bulk_create([ + CourseOverviewTab(tab_id=tab.tab_id, course_overview=course_overview) + for tab in course.tabs + ]) except IntegrityError: # There is a rare race condition that will occur if # CourseOverview.get_from_id is called while a diff --git a/openedx/core/djangoapps/content/course_overviews/startup.py b/openedx/core/djangoapps/content/course_overviews/startup.py new file mode 100644 index 0000000000..8ec2e71004 --- /dev/null +++ b/openedx/core/djangoapps/content/course_overviews/startup.py @@ -0,0 +1,5 @@ +"""Code run at server start up to initialize the course_overviews app.""" + +# Importing signals is necessary to activate signal handler, which invalidates +# the CourseOverview cache every time a course is published. +import openedx.core.djangoapps.content.course_overviews.signals # pylint: disable=unused-import diff --git a/openedx/core/djangoapps/content/course_overviews/tests.py b/openedx/core/djangoapps/content/course_overviews/tests.py index 6f4b88529e..77297f5736 100644 --- a/openedx/core/djangoapps/content/course_overviews/tests.py +++ b/openedx/core/djangoapps/content/course_overviews/tests.py @@ -367,13 +367,31 @@ class CourseOverviewTestCase(ModuleStoreTestCase): with mock.patch( 'openedx.core.djangoapps.content.course_overviews.models.CourseOverview._get_pk_val' ) as mock_get_pk_val: - mock_get_pk_val.return_value = None + # This method was not present in django 1.4. Django 1.8 calls this method if + # _get_pk_val returns None. This method will return empty str if there is no + # default value present. So mock it to avoid returning the empty str as primary key + # value. Due to empty str, model.save will do an update instead of insert which is + # incorrect and get exception in + # common.djangoapps.xmodule_django.models.OpaqueKeyField.get_prep_value + with mock.patch('django.db.models.Field.get_pk_value_on_save') as mock_get_pk_value_on_save: - # verify the CourseOverview is loaded successfully both times, - # including after an IntegrityError exception the 2nd time - for _ in range(2): - self.assertIsInstance(CourseOverview.get_from_id(course.id), CourseOverview) + mock_get_pk_value_on_save.return_value = None + + # The CourseOverviewTab entries can't get properly created when the CourseOverview used as a + # foreign key has a None 'id' - the bulk_create raises an IntegrityError. Mock out the + # CourseOverviewTab creation, as those record creations aren't what is being tested in this test. + # This mocking makes the first get_from_id() succeed with no IntegrityError - the 2nd one raises + # an IntegrityError for the reason listed above. + with mock.patch( + 'openedx.core.djangoapps.content.course_overviews.models.CourseOverviewTab.objects.bulk_create' + ) as mock_bulk_create: + mock_bulk_create.return_value = None + + # Verify the CourseOverview is loaded successfully both times, + # including after an IntegrityError exception the 2nd time. + for _ in range(2): + self.assertIsInstance(CourseOverview.get_from_id(course.id), CourseOverview) def test_course_overview_version_update(self): """ diff --git a/openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py b/openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py index b9cd6d04a1..927c3698c1 100644 --- a/openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py +++ b/openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py @@ -99,7 +99,7 @@ class CourseStructureApiTests(ModuleStoreTestCase): """ Verify that course_structure returns info for entire course. """ - with mock.patch(self.MOCK_CACHE, cache.get_cache(backend='default')): + with mock.patch(self.MOCK_CACHE, cache.caches['default']): with self.assertNumQueries(3): structure = course_structure(self.course.id) @@ -110,7 +110,7 @@ class CourseStructureApiTests(ModuleStoreTestCase): self.assertDictEqual(structure, expected) - with mock.patch(self.MOCK_CACHE, cache.get_cache(backend='default')): + with mock.patch(self.MOCK_CACHE, cache.caches['default']): with self.assertNumQueries(2): course_structure(self.course.id) @@ -120,7 +120,7 @@ class CourseStructureApiTests(ModuleStoreTestCase): """ block_types = ['html', 'video'] - with mock.patch(self.MOCK_CACHE, cache.get_cache(backend='default')): + with mock.patch(self.MOCK_CACHE, cache.caches['default']): with self.assertNumQueries(3): structure = course_structure(self.course.id, block_types=block_types) @@ -131,7 +131,7 @@ class CourseStructureApiTests(ModuleStoreTestCase): self.assertDictEqual(structure, expected) - with mock.patch(self.MOCK_CACHE, cache.get_cache(backend='default')): + with mock.patch(self.MOCK_CACHE, cache.caches['default']): with self.assertNumQueries(2): course_structure(self.course.id, block_types=block_types) diff --git a/openedx/core/djangoapps/content/course_structures/migrations/0001_initial.py b/openedx/core/djangoapps/content/course_structures/migrations/0001_initial.py index bafdf7fa04..2ebaf4035c 100644 --- a/openedx/core/djangoapps/content/course_structures/migrations/0001_initial.py +++ b/openedx/core/djangoapps/content/course_structures/migrations/0001_initial.py @@ -1,38 +1,28 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import model_utils.fields +import util.models +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseStructure' - db.create_table('course_structures_coursestructure', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), - ('structure_json', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - )) - db.send_create_signal('course_structures', ['CourseStructure']) + dependencies = [ + ] - - def backwards(self, orm): - # Deleting model 'CourseStructure' - db.delete_table('course_structures_coursestructure') - - - models = { - 'course_structures.coursestructure': { - 'Meta': {'object_name': 'CourseStructure'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'structure_json': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_structures'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='CourseStructure', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, verbose_name=b'Course ID', db_index=True)), + ('structure_json', util.models.CompressedTextField(null=True, verbose_name=b'Structure JSON', blank=True)), + ('discussion_id_map_json', util.models.CompressedTextField(null=True, verbose_name=b'Discussion ID Map JSON', blank=True)), + ], + ), + ] diff --git a/openedx/core/djangoapps/content/course_structures/migrations/0002_auto__add_field_coursestructure_discussion_id_map_json.py b/openedx/core/djangoapps/content/course_structures/migrations/0002_auto__add_field_coursestructure_discussion_id_map_json.py deleted file mode 100644 index 5d8cb4bb41..0000000000 --- a/openedx/core/djangoapps/content/course_structures/migrations/0002_auto__add_field_coursestructure_discussion_id_map_json.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CourseStructure.discussion_id_map_json' - db.add_column('course_structures_coursestructure', 'discussion_id_map_json', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CourseStructure.discussion_id_map_json' - db.delete_column('course_structures_coursestructure', 'discussion_id_map_json') - - - models = { - 'course_structures.coursestructure': { - 'Meta': {'object_name': 'CourseStructure'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'discussion_id_map_json': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'structure_json': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_structures'] \ No newline at end of file diff --git a/openedx/core/djangoapps/content/course_structures/models.py b/openedx/core/djangoapps/content/course_structures/models.py index 40a9745837..9d59311853 100644 --- a/openedx/core/djangoapps/content/course_structures/models.py +++ b/openedx/core/djangoapps/content/course_structures/models.py @@ -18,6 +18,10 @@ class CourseStructure(TimeStampedModel): """ The CourseStructure model is an aggregated representation of the course content tree """ + + class Meta(object): + app_label = 'course_structures' + course_id = CourseKeyField(max_length=255, db_index=True, unique=True, verbose_name='Course ID') # Right now the only thing we do with the structure doc is store it and diff --git a/openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py b/openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py index d613421472..22886a8a40 100644 --- a/openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py +++ b/openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py @@ -24,10 +24,7 @@ class Command(BaseCommand): with the database already migrated to post-CohortMembership state, we will use the pre-CohortMembership table CourseUserGroup as the canonical source of truth. This way, changes made in the window are persisted. """ - commit = False - if len(args) == 1: - commit = args[0] == 'commit' - + commit = 'commit' in options memberships_to_delete = 0 memberships_to_add = 0 diff --git a/openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py b/openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py index 300901bd00..893d0e777c 100644 --- a/openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py +++ b/openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py @@ -71,7 +71,7 @@ class TestPostMigrationFix(ModuleStoreTestCase): self.assertEqual(user2_cohorts, ['Course1AutoGroup2']) # CourseUserGroup and CohortMembership disagree # run the post-CohortMembership command, and commit it - call_command('post_cohort_membership_fix', 'commit') + call_command('post_cohort_membership_fix', commit='commit') # verify that both databases agree about the (corrected) state of the memberships self.assertEqual(self.user1.course_groups.count(), 1) diff --git a/openedx/core/djangoapps/course_groups/migrations/0001_initial.py b/openedx/core/djangoapps/course_groups/migrations/0001_initial.py index ca68d6628f..d1c75181a1 100644 --- a/openedx/core/djangoapps/course_groups/migrations/0001_initial.py +++ b/openedx/core/djangoapps/course_groups/migrations/0001_initial.py @@ -1,105 +1,84 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models, connection +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CourseUserGroup' + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - def table_exists(name): - return name in connection.introspection.table_names() - - def index_exists(table_name, column_name): - return column_name in connection.introspection.get_indexes(connection.cursor(), table_name) - - # Since this djangoapp has been converted to south migrations after-the-fact, - # these tables/indexes should already exist when migrating an existing installation. - if not ( - table_exists('course_groups_courseusergroup') and - index_exists('course_groups_courseusergroup', 'name') and - index_exists('course_groups_courseusergroup', 'course_id') and - table_exists('course_groups_courseusergroup_users') and - index_exists('course_groups_courseusergroup_users', 'courseusergroup_id') and - index_exists('course_groups_courseusergroup_users', 'user_id') - ): - db.create_table('course_groups_courseusergroup', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255, db_index=True)), - ('group_type', self.gf('django.db.models.fields.CharField')(max_length=20)), - )) - db.send_create_signal('course_groups', ['CourseUserGroup']) - - # Adding unique constraint on 'CourseUserGroup', fields ['name', 'course_id'] - db.create_unique('course_groups_courseusergroup', ['name', 'course_id']) - - # Adding M2M table for field users on 'CourseUserGroup' - db.create_table('course_groups_courseusergroup_users', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('courseusergroup', models.ForeignKey(orm['course_groups.courseusergroup'], null=False)), - ('user', models.ForeignKey(orm['auth.user'], null=False)) - )) - db.create_unique('course_groups_courseusergroup_users', ['courseusergroup_id', 'user_id']) - - def backwards(self, orm): - # Removing unique constraint on 'CourseUserGroup', fields ['name', 'course_id'] - db.delete_unique('course_groups_courseusergroup', ['name', 'course_id']) - - # Deleting model 'CourseUserGroup' - db.delete_table('course_groups_courseusergroup') - - # Removing M2M table for field users on 'CourseUserGroup' - db.delete_table('course_groups_courseusergroup_users') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - } - } - - complete_apps = ['course_groups'] + operations = [ + migrations.CreateModel( + name='CohortMembership', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255)), + ], + ), + migrations.CreateModel( + name='CourseCohort', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('assignment_type', models.CharField(default=b'manual', max_length=20, choices=[(b'random', b'Random'), (b'manual', b'Manual')])), + ], + ), + migrations.CreateModel( + name='CourseCohortsSettings', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('is_cohorted', models.BooleanField(default=False)), + ('course_id', xmodule_django.models.CourseKeyField(help_text=b'Which course are these settings associated with?', unique=True, max_length=255, db_index=True)), + ('_cohorted_discussions', models.TextField(null=True, db_column=b'cohorted_discussions', blank=True)), + ('always_cohort_inline_discussions', models.BooleanField(default=True)), + ], + ), + migrations.CreateModel( + name='CourseUserGroup', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(help_text=b'What is the name of this group? Must be unique within a course.', max_length=255)), + ('course_id', xmodule_django.models.CourseKeyField(help_text=b'Which course is this group associated with?', max_length=255, db_index=True)), + ('group_type', models.CharField(max_length=20, choices=[(b'cohort', b'Cohort')])), + ('users', models.ManyToManyField(help_text=b'Who is in this group?', related_name='course_groups', to=settings.AUTH_USER_MODEL, db_index=True)), + ], + ), + migrations.CreateModel( + name='CourseUserGroupPartitionGroup', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('partition_id', models.IntegerField(help_text=b'contains the id of a cohorted partition in this course')), + ('group_id', models.IntegerField(help_text=b'contains the id of a specific group within the cohorted partition')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('course_user_group', models.OneToOneField(to='course_groups.CourseUserGroup')), + ], + ), + migrations.AddField( + model_name='coursecohort', + name='course_user_group', + field=models.OneToOneField(related_name='cohort', to='course_groups.CourseUserGroup'), + ), + migrations.AddField( + model_name='cohortmembership', + name='course_user_group', + field=models.ForeignKey(to='course_groups.CourseUserGroup'), + ), + migrations.AddField( + model_name='cohortmembership', + name='user', + field=models.ForeignKey(to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='courseusergroup', + unique_together=set([('name', 'course_id')]), + ), + migrations.AlterUniqueTogether( + name='cohortmembership', + unique_together=set([('user', 'course_id')]), + ), + ] diff --git a/openedx/core/djangoapps/course_groups/migrations/0002_add_model_CourseUserGroupPartitionGroup.py b/openedx/core/djangoapps/course_groups/migrations/0002_add_model_CourseUserGroupPartitionGroup.py deleted file mode 100644 index 735dbde78b..0000000000 --- a/openedx/core/djangoapps/course_groups/migrations/0002_add_model_CourseUserGroupPartitionGroup.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseUserGroupPartitionGroup' - db.create_table('course_groups_courseusergrouppartitiongroup', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_user_group', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['course_groups.CourseUserGroup'], unique=True)), - ('partition_id', self.gf('django.db.models.fields.IntegerField')()), - ('group_id', self.gf('django.db.models.fields.IntegerField')()), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('course_groups', ['CourseUserGroupPartitionGroup']) - - def backwards(self, orm): - # Deleting model 'CourseUserGroupPartitionGroup' - db.delete_table('course_groups_courseusergrouppartitiongroup') - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - }, - 'course_groups.courseusergrouppartitiongroup': { - 'Meta': {'object_name': 'CourseUserGroupPartitionGroup'}, - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['course_groups.CourseUserGroup']", 'unique': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'group_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'partition_id': ('django.db.models.fields.IntegerField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_groups'] diff --git a/openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py b/openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py deleted file mode 100644 index 765f338d9f..0000000000 --- a/openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CourseCohort' - db.create_table('course_groups_coursecohort', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_user_group', self.gf('django.db.models.fields.related.OneToOneField')(related_name='cohort', unique=True, to=orm['course_groups.CourseUserGroup'])), - ('assignment_type', self.gf('django.db.models.fields.CharField')(default='manual', max_length=20)), - )) - db.send_create_signal('course_groups', ['CourseCohort']) - - # Adding model 'CourseCohortsSettings' - db.create_table('course_groups_coursecohortssettings', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('is_cohorted', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), - ('cohorted_discussions', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('always_cohort_inline_discussions', self.gf('django.db.models.fields.BooleanField')(default=True)), - )) - db.send_create_signal('course_groups', ['CourseCohortsSettings']) - - - def backwards(self, orm): - # Deleting model 'CourseCohort' - db.delete_table('course_groups_coursecohort') - - # Deleting model 'CourseCohortsSettings' - db.delete_table('course_groups_coursecohortssettings') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.coursecohort': { - 'Meta': {'object_name': 'CourseCohort'}, - 'assignment_type': ('django.db.models.fields.CharField', [], {'default': "'manual'", 'max_length': '20'}), - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'cohort'", 'unique': 'True', 'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'course_groups.coursecohortssettings': { - 'Meta': {'object_name': 'CourseCohortsSettings'}, - 'always_cohort_inline_discussions': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'cohorted_discussions': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_cohorted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - }, - 'course_groups.courseusergrouppartitiongroup': { - 'Meta': {'object_name': 'CourseUserGroupPartitionGroup'}, - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['course_groups.CourseUserGroup']", 'unique': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'group_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'partition_id': ('django.db.models.fields.IntegerField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_groups'] \ No newline at end of file diff --git a/openedx/core/djangoapps/course_groups/migrations/0004_auto__del_field_coursecohortssettings_cohorted_discussions__add_field_.py b/openedx/core/djangoapps/course_groups/migrations/0004_auto__del_field_coursecohortssettings_cohorted_discussions__add_field_.py deleted file mode 100644 index 3863c0943c..0000000000 --- a/openedx/core/djangoapps/course_groups/migrations/0004_auto__del_field_coursecohortssettings_cohorted_discussions__add_field_.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Changed 'CourseCohortsSettings.cohorted_discussions' to 'CourseCohortsSettings._cohorted_discussions' without - # changing db column name - pass - - def backwards(self, orm): - # Changed 'CourseCohortsSettings.cohorted_discussions' to 'CourseCohortsSettings._cohorted_discussions' without - # changing db column name - pass - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.coursecohort': { - 'Meta': {'object_name': 'CourseCohort'}, - 'assignment_type': ('django.db.models.fields.CharField', [], {'default': "'manual'", 'max_length': '20'}), - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'cohort'", 'unique': 'True', 'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'course_groups.coursecohortssettings': { - 'Meta': {'object_name': 'CourseCohortsSettings'}, - '_cohorted_discussions': ('django.db.models.fields.TextField', [], {'null': 'True', 'db_column': "'cohorted_discussions'", 'blank': 'True'}), - 'always_cohort_inline_discussions': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_cohorted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - }, - 'course_groups.courseusergrouppartitiongroup': { - 'Meta': {'object_name': 'CourseUserGroupPartitionGroup'}, - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['course_groups.CourseUserGroup']", 'unique': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'group_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'partition_id': ('django.db.models.fields.IntegerField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_groups'] \ No newline at end of file diff --git a/openedx/core/djangoapps/course_groups/migrations/0005_cohort_membership.py b/openedx/core/djangoapps/course_groups/migrations/0005_cohort_membership.py deleted file mode 100644 index 8993f26e59..0000000000 --- a/openedx/core/djangoapps/course_groups/migrations/0005_cohort_membership.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CohortMembership' - db.create_table('course_groups_cohortmembership', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_user_group', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['course_groups.CourseUserGroup'])), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)), - )) - db.send_create_signal('course_groups', ['CohortMembership']) - - # Adding unique constraint on 'CohortMembership', fields ['user', 'course_id'] - db.create_unique('course_groups_cohortmembership', ['user_id', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CohortMembership', fields ['user', 'course_id'] - db.delete_unique('course_groups_cohortmembership', ['user_id', 'course_id']) - - # Deleting model 'CohortMembership' - db.delete_table('course_groups_cohortmembership') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.cohortmembership': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CohortMembership'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'course_user_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'course_groups.coursecohort': { - 'Meta': {'object_name': 'CourseCohort'}, - 'assignment_type': ('django.db.models.fields.CharField', [], {'default': "'manual'", 'max_length': '20'}), - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'cohort'", 'unique': 'True', 'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'course_groups.coursecohortssettings': { - 'Meta': {'object_name': 'CourseCohortsSettings'}, - '_cohorted_discussions': ('django.db.models.fields.TextField', [], {'null': 'True', 'db_column': "'cohorted_discussions'", 'blank': 'True'}), - 'always_cohort_inline_discussions': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_cohorted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - }, - 'course_groups.courseusergrouppartitiongroup': { - 'Meta': {'object_name': 'CourseUserGroupPartitionGroup'}, - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['course_groups.CourseUserGroup']", 'unique': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'group_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'partition_id': ('django.db.models.fields.IntegerField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_groups'] diff --git a/openedx/core/djangoapps/course_groups/migrations/0006_cohort_membership_data_migrate.py b/openedx/core/djangoapps/course_groups/migrations/0006_cohort_membership_data_migrate.py deleted file mode 100644 index 523d7007b0..0000000000 --- a/openedx/core/djangoapps/course_groups/migrations/0006_cohort_membership_data_migrate.py +++ /dev/null @@ -1,138 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models, IntegrityError, transaction - - -class Migration(DataMigration): - - def forwards(self, orm): - # Matches CourseUserGroup.COHORT - cohort_type = 'cohort' - - for cohort_group in orm.CourseUserGroup.objects.all(): - for user in cohort_group.users.all(): - current_course_groups = orm.CourseUserGroup.objects.filter( - course_id=cohort_group.course_id, - users__id=user.id, - group_type=cohort_type - ) - current_user_groups = user.course_groups.filter( - course_id=cohort_group.course_id, - group_type=cohort_type - ) - - unioned_set = set(current_course_groups).union(set(current_user_groups)) - - # Per product guidance, fix problem users by arbitrarily choosing a single membership to retain - arbitrary_cohort_to_keep = unioned_set.pop() - - try: - membership = orm.CohortMembership( - course_user_group=arbitrary_cohort_to_keep, - user=user, - course_id=arbitrary_cohort_to_keep.course_id - ) - membership.save() - except IntegrityError: - # It's possible a user already has a conflicting entry in the db. Treat that as correct. - unioned_set.add(arbitrary_cohort_to_keep) - try: - valid_membership = orm.CohortMembership.objects.get( - course_id = cohort_group.course_id, - user__id=user.id - ) - actual_cohort_to_keep = orm.CourseUserGroup.objects.get( - id=valid_membership.course_user_group.id - ) - unioned_set.remove(actual_cohort_to_keep) - except KeyError: - actual_cohort_to_keep.users.add(user) - - for cohort_itr in unioned_set: - cohort_itr.users.remove(user) - user.course_groups.remove(cohort_itr) - - def backwards(self, orm): - # A backwards migration just means dropping the table, which 0005 handles in its backwards() method - pass - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'course_groups.cohortmembership': { - 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CohortMembership'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255'}), - 'course_user_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'course_groups.coursecohort': { - 'Meta': {'object_name': 'CourseCohort'}, - 'assignment_type': ('django.db.models.fields.CharField', [], {'default': "'manual'", 'max_length': '20'}), - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'cohort'", 'unique': 'True', 'to': "orm['course_groups.CourseUserGroup']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'course_groups.coursecohortssettings': { - 'Meta': {'object_name': 'CourseCohortsSettings'}, - '_cohorted_discussions': ('django.db.models.fields.TextField', [], {'null': 'True', 'db_column': "'cohorted_discussions'", 'blank': 'True'}), - 'always_cohort_inline_discussions': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_cohorted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - 'course_groups.courseusergroup': { - 'Meta': {'unique_together': "(('name', 'course_id'),)", 'object_name': 'CourseUserGroup'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'group_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'related_name': "'course_groups'", 'symmetrical': 'False', 'to': "orm['auth.User']"}) - }, - 'course_groups.courseusergrouppartitiongroup': { - 'Meta': {'object_name': 'CourseUserGroupPartitionGroup'}, - 'course_user_group': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['course_groups.CourseUserGroup']", 'unique': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'group_id': ('django.db.models.fields.IntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'partition_id': ('django.db.models.fields.IntegerField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['course_groups'] diff --git a/openedx/core/djangoapps/course_groups/models.py b/openedx/core/djangoapps/course_groups/models.py index f257127823..7001fcd284 100644 --- a/openedx/core/djangoapps/course_groups/models.py +++ b/openedx/core/djangoapps/course_groups/models.py @@ -73,15 +73,6 @@ class CohortMembership(models.Model): class Meta(object): unique_together = (('user', 'course_id'), ) - # The sole purpose of overriding this method is to get the django 1.6 behavior of allowing 'validate_unique' - # For django 1.8 upgrade, just remove this method and allow the base method to be called instead. - # Reference: https://docs.djangoproject.com/en/1.6/ref/models/instances/, under "Validating Objects" - def full_clean(self, **kwargs): - self.clean_fields() - self.clean() - if 'validate_unique' not in kwargs or kwargs['validate_unique'] is True: - self.validate_unique() - def clean_fields(self, *args, **kwargs): if self.course_id is None: self.course_id = self.course_user_group.course_id @@ -106,24 +97,20 @@ class CohortMembership(models.Model): max_retries = 2 success = False for __ in range(max_retries): - # The following 2 "transaction" lines force a fresh read, they can be removed once we're on django 1.8 - # http://stackoverflow.com/questions/3346124/how-do-i-force-django-to-ignore-any-caches-and-reload-data - with transaction.commit_manually(): - transaction.commit() - with transaction.commit_on_success(): + with transaction.atomic(): try: - saved_membership, created = CohortMembership.objects.select_for_update().get_or_create( - user__id=self.user.id, # pylint: disable=E1101 - course_id=self.course_id, - defaults={ - 'course_user_group': self.course_user_group, - 'user': self.user - } - ) + with transaction.atomic(): + saved_membership, created = CohortMembership.objects.select_for_update().get_or_create( + user__id=self.user.id, # pylint: disable=E1101 + course_id=self.course_id, + defaults={ + 'course_user_group': self.course_user_group, + 'user': self.user + } + ) except IntegrityError: # This can happen if simultaneous requests try to create a membership - transaction.rollback() continue if not created: @@ -140,8 +127,7 @@ class CohortMembership(models.Model): saved_membership.course_user_group = self.course_user_group self.course_user_group.users.add(self.user) # pylint: disable=E1101 - #note: in django 1.8, we can call save with updated_fields=['course_user_group'] - super(CohortMembership, saved_membership).save() + super(CohortMembership, saved_membership).save(update_fields=['course_user_group']) success = True break diff --git a/openedx/core/djangoapps/course_groups/tests/test_views.py b/openedx/core/djangoapps/course_groups/tests/test_views.py index ec93ea6b6f..eb2271484a 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_views.py +++ b/openedx/core/djangoapps/course_groups/tests/test_views.py @@ -14,9 +14,6 @@ from django.contrib.auth.models import User from django.http import Http404 from django.test.client import RequestFactory -# monkey-patch for PATCH request method. -import openedx.core.lib.django_test_client_utils # pylint: disable=unused-import - from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase diff --git a/openedx/core/djangoapps/credit/api/provider.py b/openedx/core/djangoapps/credit/api/provider.py index 8e2bf81d21..ef2acc36c5 100644 --- a/openedx/core/djangoapps/credit/api/provider.py +++ b/openedx/core/djangoapps/credit/api/provider.py @@ -108,7 +108,7 @@ def get_credit_provider_info(request, provider_id): # pylint: disable=unused-ar return JsonResponse(credit_provider_data) -@transaction.commit_on_success +@transaction.atomic def create_credit_request(course_key, provider_id, username): """ Initiate a request for credit from a credit provider. diff --git a/openedx/core/djangoapps/credit/email_utils.py b/openedx/core/djangoapps/credit/email_utils.py index 54c6c8f8f6..3375abb48f 100644 --- a/openedx/core/djangoapps/credit/email_utils.py +++ b/openedx/core/djangoapps/credit/email_utils.py @@ -14,13 +14,12 @@ from django.conf import settings from django.contrib.auth.models import User from django.contrib.staticfiles import finders from django.core.cache import cache -from django.core.mail import EmailMessage +from django.core.mail import EmailMessage, SafeMIMEText from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart -from email.mime.text import MIMEText from eventtracking import tracker from edxmako.shortcuts import render_to_string @@ -89,7 +88,7 @@ def send_credit_notifications(username, course_key): # add alternative plain text message email_body_plain = render_to_string('credit_notifications/credit_eligibility_email.txt', context) - msg_alternative.attach(MIMEText(email_body_plain, _subtype='plain', _charset='utf-8')) + msg_alternative.attach(SafeMIMEText(email_body_plain, _subtype='plain', _charset='utf-8')) # add alternative html message email_body_content = cache.get('credit.email.css-email-body') @@ -109,7 +108,7 @@ def send_credit_notifications(username, course_key): email_body_content = '' email_body = Template(email_body_content).render([context]) - msg_alternative.attach(MIMEText(email_body, _subtype='html', _charset='utf-8')) + msg_alternative.attach(SafeMIMEText(email_body, _subtype='html', _charset='utf-8')) # attach logo image if logo_image: diff --git a/openedx/core/djangoapps/credit/migrations/0001_initial.py b/openedx/core/djangoapps/credit/migrations/0001_initial.py index ce708422a8..0ea46d557a 100644 --- a/openedx/core/djangoapps/credit/migrations/0001_initial.py +++ b/openedx/core/djangoapps/credit/migrations/0001_initial.py @@ -1,140 +1,173 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import openedx.core.djangoapps.credit.models +import model_utils.fields +import xmodule_django.models +import jsonfield.fields +import django.db.models.deletion +import django.utils.timezone +from django.conf import settings +import django.core.validators -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'CreditCourse' - db.create_table('credit_creditcourse', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('course_key', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('credit', ['CreditCourse']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding model 'CreditProvider' - db.create_table('credit_creditprovider', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('provider_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255, db_index=True)), - ('display_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal('credit', ['CreditProvider']) - - # Adding model 'CreditRequirement' - db.create_table('credit_creditrequirement', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('course', self.gf('django.db.models.fields.related.ForeignKey')(related_name='credit_requirements', to=orm['credit.CreditCourse'])), - ('namespace', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('configuration', self.gf('jsonfield.fields.JSONField')()), - ('active', self.gf('django.db.models.fields.BooleanField')(default=True)), - )) - db.send_create_signal('credit', ['CreditRequirement']) - - # Adding unique constraint on 'CreditRequirement', fields ['namespace', 'name', 'course'] - db.create_unique('credit_creditrequirement', ['namespace', 'name', 'course_id']) - - # Adding model 'CreditRequirementStatus' - db.create_table('credit_creditrequirementstatus', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('requirement', self.gf('django.db.models.fields.related.ForeignKey')(related_name='statuses', to=orm['credit.CreditRequirement'])), - ('status', self.gf('django.db.models.fields.CharField')(max_length=32)), - )) - db.send_create_signal('credit', ['CreditRequirementStatus']) - - # Adding model 'CreditEligibility' - db.create_table('credit_crediteligibility', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('course', self.gf('django.db.models.fields.related.ForeignKey')(related_name='eligibilities', to=orm['credit.CreditCourse'])), - ('provider', self.gf('django.db.models.fields.related.ForeignKey')(related_name='eligibilities', to=orm['credit.CreditProvider'])), - )) - db.send_create_signal('credit', ['CreditEligibility']) - - # Adding unique constraint on 'CreditEligibility', fields ['username', 'course'] - db.create_unique('credit_crediteligibility', ['username', 'course_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CreditEligibility', fields ['username', 'course'] - db.delete_unique('credit_crediteligibility', ['username', 'course_id']) - - # Removing unique constraint on 'CreditRequirement', fields ['namespace', 'name', 'course'] - db.delete_unique('credit_creditrequirement', ['namespace', 'name', 'course_id']) - - # Deleting model 'CreditCourse' - db.delete_table('credit_creditcourse') - - # Deleting model 'CreditProvider' - db.delete_table('credit_creditprovider') - - # Deleting model 'CreditRequirement' - db.delete_table('credit_creditrequirement') - - # Deleting model 'CreditRequirementStatus' - db.delete_table('credit_creditrequirementstatus') - - # Deleting model 'CreditEligibility' - db.delete_table('credit_crediteligibility') - - - models = { - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'configuration': ('jsonfield.fields.JSONField', [], {}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] + operations = [ + migrations.CreateModel( + name='CreditCourse', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('course_key', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), + ('enabled', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='CreditEligibility', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('username', models.CharField(max_length=255, db_index=True)), + ('deadline', models.DateTimeField(default=openedx.core.djangoapps.credit.models.default_deadline_for_credit_eligibility, help_text='Deadline for purchasing and requesting credit.')), + ('course', models.ForeignKey(related_name='eligibilities', to='credit.CreditCourse')), + ], + options={ + 'verbose_name_plural': 'Credit eligibilities', + }, + ), + migrations.CreateModel( + name='CreditProvider', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('provider_id', models.CharField(help_text='Unique identifier for this credit provider. Only alphanumeric characters and hyphens (-) are allowed. The identifier is case-sensitive.', unique=True, max_length=255, validators=[django.core.validators.RegexValidator(regex=b'^[a-z,A-Z,0-9,\\-]+$', message=b'Only alphanumeric characters and hyphens (-) are allowed', code=b'invalid_provider_id')])), + ('active', models.BooleanField(default=True, help_text='Whether the credit provider is currently enabled.')), + ('display_name', models.CharField(help_text='Name of the credit provider displayed to users', max_length=255)), + ('enable_integration', models.BooleanField(default=False, help_text='When true, automatically notify the credit provider when a user requests credit. In order for this to work, a shared secret key MUST be configured for the credit provider in secure auth settings.')), + ('provider_url', models.URLField(default=b'', help_text='URL of the credit provider. If automatic integration is enabled, this will the the end-point that we POST to to notify the provider of a credit request. Otherwise, the user will be shown a link to this URL, so the user can request credit from the provider directly.')), + ('provider_status_url', models.URLField(default=b'', help_text='URL from the credit provider where the user can check the status of his or her request for credit. This is displayed to students *after* they have requested credit.')), + ('provider_description', models.TextField(default=b'', help_text='Description for the credit provider displayed to users.')), + ('fulfillment_instructions', models.TextField(help_text='Plain text or html content for displaying further steps on receipt page *after* paying for the credit to get credit for a credit course against a credit provider.', null=True, blank=True)), + ('eligibility_email_message', models.TextField(default=b'', help_text='Plain text or html content for displaying custom message inside credit eligibility email content which is sent when user has met all credit eligibility requirements.')), + ('receipt_email_message', models.TextField(default=b'', help_text='Plain text or html content for displaying custom message inside credit receipt email content which is sent *after* paying to get credit for a credit course.')), + ('thumbnail_url', models.URLField(default=b'', help_text='Thumbnail image url of the credit provider.', max_length=255)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='CreditRequest', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('uuid', models.CharField(unique=True, max_length=32, db_index=True)), + ('username', models.CharField(max_length=255, db_index=True)), + ('parameters', jsonfield.fields.JSONField()), + ('status', models.CharField(default=b'pending', max_length=255, choices=[(b'pending', b'Pending'), (b'approved', b'Approved'), (b'rejected', b'Rejected')])), + ('course', models.ForeignKey(related_name='credit_requests', to='credit.CreditCourse')), + ('provider', models.ForeignKey(related_name='credit_requests', to='credit.CreditProvider')), + ], + options={ + 'get_latest_by': 'created', + }, + ), + migrations.CreateModel( + name='CreditRequirement', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('namespace', models.CharField(max_length=255)), + ('name', models.CharField(max_length=255)), + ('display_name', models.CharField(default=b'', max_length=255)), + ('order', models.PositiveIntegerField(default=0)), + ('criteria', jsonfield.fields.JSONField()), + ('active', models.BooleanField(default=True)), + ('course', models.ForeignKey(related_name='credit_requirements', to='credit.CreditCourse')), + ], + options={ + 'ordering': ['order'], + }, + ), + migrations.CreateModel( + name='CreditRequirementStatus', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('username', models.CharField(max_length=255, db_index=True)), + ('status', models.CharField(max_length=32, choices=[(b'satisfied', b'satisfied'), (b'failed', b'failed'), (b'declined', b'declined')])), + ('reason', jsonfield.fields.JSONField(default={})), + ('requirement', models.ForeignKey(related_name='statuses', to='credit.CreditRequirement')), + ], + ), + migrations.CreateModel( + name='HistoricalCreditRequest', + fields=[ + ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('uuid', models.CharField(max_length=32, db_index=True)), + ('username', models.CharField(max_length=255, db_index=True)), + ('parameters', jsonfield.fields.JSONField()), + ('status', models.CharField(default=b'pending', max_length=255, choices=[(b'pending', b'Pending'), (b'approved', b'Approved'), (b'rejected', b'Rejected')])), + ('history_id', models.AutoField(serialize=False, primary_key=True)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), + ('course', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='credit.CreditCourse', null=True)), + ('history_user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ('provider', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='credit.CreditProvider', null=True)), + ], + options={ + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + 'verbose_name': 'historical credit request', + }, + ), + migrations.CreateModel( + name='HistoricalCreditRequirementStatus', + fields=[ + ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('username', models.CharField(max_length=255, db_index=True)), + ('status', models.CharField(max_length=32, choices=[(b'satisfied', b'satisfied'), (b'failed', b'failed'), (b'declined', b'declined')])), + ('reason', jsonfield.fields.JSONField(default={})), + ('history_id', models.AutoField(serialize=False, primary_key=True)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), + ('history_user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), + ('requirement', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='credit.CreditRequirement', null=True)), + ], + options={ + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + 'verbose_name': 'historical credit requirement status', + }, + ), + migrations.AlterUniqueTogether( + name='creditrequirementstatus', + unique_together=set([('username', 'requirement')]), + ), + migrations.AlterUniqueTogether( + name='creditrequirement', + unique_together=set([('namespace', 'name', 'course')]), + ), + migrations.AlterUniqueTogether( + name='creditrequest', + unique_together=set([('username', 'course', 'provider')]), + ), + migrations.AlterUniqueTogether( + name='crediteligibility', + unique_together=set([('username', 'course')]), + ), + ] diff --git a/openedx/core/djangoapps/credit/migrations/0002_rename_credit_requirement_criteria_field.py b/openedx/core/djangoapps/credit/migrations/0002_rename_credit_requirement_criteria_field.py deleted file mode 100644 index 6efd53ae8a..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0002_rename_credit_requirement_criteria_field.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CreditRequirement.configuration' - db.delete_column('credit_creditrequirement', 'configuration') - - # Adding field 'CreditRequirement.criteria' - db.add_column('credit_creditrequirement', 'criteria', - self.gf('jsonfield.fields.JSONField')(default=''), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'CreditRequirement.configuration' - db.add_column('credit_creditrequirement', 'configuration', - self.gf('jsonfield.fields.JSONField')(default=''), - keep_default=False) - - # Deleting field 'CreditRequirement.criteria' - db.delete_column('credit_creditrequirement', 'criteria') - - - models = { - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0003_add_creditrequirementstatus_reason.py b/openedx/core/djangoapps/credit/migrations/0003_add_creditrequirementstatus_reason.py deleted file mode 100644 index 6a3c03ec65..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0003_add_creditrequirementstatus_reason.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditRequirementStatus.reason' - db.add_column('credit_creditrequirementstatus', 'reason', - self.gf('jsonfield.fields.JSONField')(default={}), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditRequirementStatus.reason' - db.delete_column('credit_creditrequirementstatus', 'reason') - - - models = { - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0004_auto__add_field_creditrequirement_display_name.py b/openedx/core/djangoapps/credit/migrations/0004_auto__add_field_creditrequirement_display_name.py deleted file mode 100644 index 7c49053dbe..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0004_auto__add_field_creditrequirement_display_name.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditRequirement.display_name' - db.add_column('credit_creditrequirement', 'display_name', - self.gf('django.db.models.fields.CharField')(default='', max_length=255), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditRequirement.display_name' - db.delete_column('credit_creditrequirement', 'display_name') - - - models = { - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0005_auto__add_field_creditprovider_provider_url__add_field_creditprovider_.py b/openedx/core/djangoapps/credit/migrations/0005_auto__add_field_creditprovider_provider_url__add_field_creditprovider_.py deleted file mode 100644 index 75eda25173..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0005_auto__add_field_creditprovider_provider_url__add_field_creditprovider_.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.provider_url' - db.add_column('credit_creditprovider', 'provider_url', - self.gf('django.db.models.fields.URLField')(default='', unique=True, max_length=255), - keep_default=False) - - # Adding field 'CreditProvider.eligibility_duration' - db.add_column('credit_creditprovider', 'eligibility_duration', - self.gf('django.db.models.fields.PositiveIntegerField')(default=0), - keep_default=False) - - # Adding field 'CreditProvider.active' - db.add_column('credit_creditprovider', 'active', - self.gf('django.db.models.fields.BooleanField')(default=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.provider_url' - db.delete_column('credit_creditprovider', 'provider_url') - - # Deleting field 'CreditProvider.eligibility_duration' - db.delete_column('credit_creditprovider', 'eligibility_duration') - - # Deleting field 'CreditProvider.active' - db.delete_column('credit_creditprovider', 'active') - - - models = { - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '255'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0006_auto__add_creditrequest__add_unique_creditrequest_username_course_prov.py b/openedx/core/djangoapps/credit/migrations/0006_auto__add_creditrequest__add_unique_creditrequest_username_course_prov.py deleted file mode 100644 index 723aa9fedc..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0006_auto__add_creditrequest__add_unique_creditrequest_username_course_prov.py +++ /dev/null @@ -1,190 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'CreditRequest' - db.create_table('credit_creditrequest', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('uuid', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32, db_index=True)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('course', self.gf('django.db.models.fields.related.ForeignKey')(related_name='credit_requests', to=orm['credit.CreditCourse'])), - ('provider', self.gf('django.db.models.fields.related.ForeignKey')(related_name='credit_requests', to=orm['credit.CreditProvider'])), - ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('parameters', self.gf('jsonfield.fields.JSONField')()), - ('status', self.gf('django.db.models.fields.CharField')(default='pending', max_length=255)), - )) - db.send_create_signal('credit', ['CreditRequest']) - - # Adding unique constraint on 'CreditRequest', fields ['username', 'course', 'provider'] - db.create_unique('credit_creditrequest', ['username', 'course_id', 'provider_id']) - - # Adding model 'HistoricalCreditRequest' - db.create_table('credit_historicalcreditrequest', ( - ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('uuid', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('timestamp', self.gf('django.db.models.fields.DateTimeField')(blank=True)), - ('parameters', self.gf('jsonfield.fields.JSONField')()), - ('status', self.gf('django.db.models.fields.CharField')(default='pending', max_length=255)), - ('course', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name=u'+', null=True, on_delete=models.DO_NOTHING, to=orm['credit.CreditCourse'])), - ('provider', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name=u'+', null=True, on_delete=models.DO_NOTHING, to=orm['credit.CreditProvider'])), - (u'history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - (u'history_date', self.gf('django.db.models.fields.DateTimeField')()), - (u'history_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name=u'+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - (u'history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), - )) - db.send_create_signal('credit', ['HistoricalCreditRequest']) - - # Adding M2M table for field providers on 'CreditCourse' - m2m_table_name = db.shorten_name('credit_creditcourse_providers') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('creditcourse', models.ForeignKey(orm['credit.creditcourse'], null=False)), - ('creditprovider', models.ForeignKey(orm['credit.creditprovider'], null=False)) - )) - db.create_unique(m2m_table_name, ['creditcourse_id', 'creditprovider_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CreditRequest', fields ['username', 'course', 'provider'] - db.delete_unique('credit_creditrequest', ['username', 'course_id', 'provider_id']) - - # Deleting model 'CreditRequest' - db.delete_table('credit_creditrequest') - - # Deleting model 'HistoricalCreditRequest' - db.delete_table('credit_historicalcreditrequest') - - # Removing M2M table for field providers on 'CreditCourse' - db.delete_table(db.shorten_name('credit_creditcourse_providers')) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'unique': 'True', 'max_length': '255'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py b/openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py deleted file mode 100644 index 7e6ef2e773..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'CreditProvider', fields ['provider_url'] - db.delete_unique('credit_creditprovider', ['provider_url']) - - # Adding field 'CreditProvider.enable_integration' - db.add_column('credit_creditprovider', 'enable_integration', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - # Changing field 'CreditProvider.provider_url' - db.alter_column('credit_creditprovider', 'provider_url', self.gf('django.db.models.fields.URLField')(max_length=200)) - - def backwards(self, orm): - # Deleting field 'CreditProvider.enable_integration' - db.delete_column('credit_creditprovider', 'enable_integration') - - - # Changing field 'CreditProvider.provider_url' - db.alter_column('credit_creditprovider', 'provider_url', self.gf('django.db.models.fields.URLField')(max_length=255, unique=True)) - # Adding unique constraint on 'CreditProvider', fields ['provider_url'] - db.create_unique('credit_creditprovider', ['provider_url']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'timestamp': ('django.db.models.fields.DateTimeField', [], {'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0008_delete_credit_provider_timestamp.py b/openedx/core/djangoapps/credit/migrations/0008_delete_credit_provider_timestamp.py deleted file mode 100644 index 6fa6b68501..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0008_delete_credit_provider_timestamp.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CreditRequest.timestamp' - db.delete_column('credit_creditrequest', 'timestamp') - - # Deleting field 'HistoricalCreditRequest.timestamp' - db.delete_column('credit_historicalcreditrequest', 'timestamp') - - def backwards(self, orm): - # Adding field 'CreditRequest.timestamp' - db.add_column('credit_creditrequest', 'timestamp', - self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime.utcnow(), blank=True), - keep_default=False) - - # Adding field 'HistoricalCreditRequest.timestamp' - db.add_column('credit_historicalcreditrequest', 'timestamp', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.utcnow(), blank=True), - keep_default=False) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditProvider']"}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0009_auto__del_field_crediteligibility_provider.py b/openedx/core/djangoapps/credit/migrations/0009_auto__del_field_crediteligibility_provider.py deleted file mode 100644 index 73cd9be397..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0009_auto__del_field_crediteligibility_provider.py +++ /dev/null @@ -1,138 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CreditEligibility.provider' - db.delete_column('credit_crediteligibility', 'provider_id') - - - def backwards(self, orm): - # Adding field 'CreditEligibility.provider' - db.add_column('credit_crediteligibility', 'provider', - self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='eligibilities', to=orm['credit.CreditProvider']), - keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0010_add_creditrequirementstatus_history.py b/openedx/core/djangoapps/credit/migrations/0010_add_creditrequirementstatus_history.py deleted file mode 100644 index 777e86782d..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0010_add_creditrequirementstatus_history.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'HistoricalCreditRequirementStatus' - db.create_table('credit_historicalcreditrequirementstatus', ( - ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('username', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('status', self.gf('django.db.models.fields.CharField')(max_length=32)), - ('reason', self.gf('jsonfield.fields.JSONField')(default={})), - ('requirement', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name=u'+', null=True, on_delete=models.DO_NOTHING, to=orm['credit.CreditRequirement'])), - (u'history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - (u'history_date', self.gf('django.db.models.fields.DateTimeField')()), - (u'history_user', self.gf('django.db.models.fields.related.ForeignKey')(related_name=u'+', null=True, on_delete=models.SET_NULL, to=orm['auth.User'])), - (u'history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), - )) - db.send_create_signal('credit', ['HistoricalCreditRequirementStatus']) - - # Adding unique constraint on 'CreditRequirementStatus', fields ['username', 'requirement'] - db.create_unique('credit_creditrequirementstatus', ['username', 'requirement_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'CreditRequirementStatus', fields ['username', 'requirement'] - db.delete_unique('credit_creditrequirementstatus', ['username', 'requirement_id']) - - # Deleting model 'HistoricalCreditRequirementStatus' - db.delete_table('credit_historicalcreditrequirementstatus') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0011_auto__add_field_creditrequirement_order.py b/openedx/core/djangoapps/credit/migrations/0011_auto__add_field_creditrequirement_order.py deleted file mode 100644 index 84350b92bf..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0011_auto__add_field_creditrequirement_order.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditRequirement.order' - db.add_column('credit_creditrequirement', 'order', - self.gf('django.db.models.fields.PositiveIntegerField')(default=0), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditRequirement.order' - db.delete_column('credit_creditrequirement', 'order') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'providers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['credit.CreditProvider']", 'symmetrical': 'False'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_duration': ('django.db.models.fields.PositiveIntegerField', [], {'default': '31556970'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0012_remove_m2m_course_and_provider.py b/openedx/core/djangoapps/credit/migrations/0012_remove_m2m_course_and_provider.py deleted file mode 100644 index ef2599c17b..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0012_remove_m2m_course_and_provider.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'CreditProvider.eligibility_duration' - db.delete_column('credit_creditprovider', 'eligibility_duration') - - # Removing M2M table for field providers on 'CreditCourse' - db.delete_table(db.shorten_name('credit_creditcourse_providers')) - - # Adding field 'CreditEligibility.deadline' - db.add_column('credit_crediteligibility', 'deadline', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2016, 6, 26, 0, 0)), - keep_default=False) - - - def backwards(self, orm): - # Adding field 'CreditProvider.eligibility_duration' - db.add_column('credit_creditprovider', 'eligibility_duration', - self.gf('django.db.models.fields.PositiveIntegerField')(default=31556970), - keep_default=False) - - # Adding M2M table for field providers on 'CreditCourse' - m2m_table_name = db.shorten_name('credit_creditcourse_providers') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('creditcourse', models.ForeignKey(orm['credit.creditcourse'], null=False)), - ('creditprovider', models.ForeignKey(orm['credit.creditprovider'], null=False)) - )) - db.create_unique(m2m_table_name, ['creditcourse_id', 'creditprovider_id']) - - # Deleting field 'CreditEligibility.deadline' - db.delete_column('credit_crediteligibility', 'deadline') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 6, 26, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0013_add_provider_status_url.py b/openedx/core/djangoapps/credit/migrations/0013_add_provider_status_url.py deleted file mode 100644 index a0142f6c50..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0013_add_provider_status_url.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.provider_status_url' - db.add_column('credit_creditprovider', 'provider_status_url', - self.gf('django.db.models.fields.URLField')(default='', max_length=200), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.provider_status_url' - db.delete_column('credit_creditprovider', 'provider_status_url') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 6, 26, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_status_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/migrations/0014_auto__add_field_creditprovider_fulfillment_instructions.py b/openedx/core/djangoapps/credit/migrations/0014_auto__add_field_creditprovider_fulfillment_instructions.py deleted file mode 100644 index b818845cb4..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0014_auto__add_field_creditprovider_fulfillment_instructions.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.fulfillment_instructions' - db.add_column('credit_creditprovider', 'fulfillment_instructions', - self.gf('django.db.models.fields.TextField')(null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.fulfillment_instructions' - db.delete_column('credit_creditprovider', 'fulfillment_instructions') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 7, 6, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'fulfillment_instructions': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_status_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0015_auto__add_field_creditprovider_provider_description.py b/openedx/core/djangoapps/credit/migrations/0015_auto__add_field_creditprovider_provider_description.py deleted file mode 100644 index 2c29cdad96..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0015_auto__add_field_creditprovider_provider_description.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.provider_description' - db.add_column('credit_creditprovider', 'provider_description', - self.gf('django.db.models.fields.TextField')(default=''), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.provider_description' - db.delete_column('credit_creditprovider', 'provider_description') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 7, 8, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'fulfillment_instructions': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_description': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_status_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0016_auto__add_field_creditprovider_eligibility_email_message__add_field_cr.py b/openedx/core/djangoapps/credit/migrations/0016_auto__add_field_creditprovider_eligibility_email_message__add_field_cr.py deleted file mode 100644 index 64417e8398..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0016_auto__add_field_creditprovider_eligibility_email_message__add_field_cr.py +++ /dev/null @@ -1,165 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.eligibility_email_message' - db.add_column('credit_creditprovider', 'eligibility_email_message', - self.gf('django.db.models.fields.TextField')(default=''), - keep_default=False) - - # Adding field 'CreditProvider.receipt_email_message' - db.add_column('credit_creditprovider', 'receipt_email_message', - self.gf('django.db.models.fields.TextField')(default=''), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.eligibility_email_message' - db.delete_column('credit_creditprovider', 'eligibility_email_message') - - # Deleting field 'CreditProvider.receipt_email_message' - db.delete_column('credit_creditprovider', 'receipt_email_message') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 7, 9, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_email_message': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'fulfillment_instructions': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_description': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_status_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'receipt_email_message': ('django.db.models.fields.TextField', [], {'default': "''"}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] \ No newline at end of file diff --git a/openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py b/openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py deleted file mode 100644 index ddc88ead35..0000000000 --- a/openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py +++ /dev/null @@ -1,158 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'CreditProvider.thumbnail_url' - db.add_column('credit_creditprovider', 'thumbnail_url', - self.gf('django.db.models.fields.URLField')(default='', max_length=255), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'CreditProvider.thumbnail_url' - db.delete_column('credit_creditprovider', 'thumbnail_url') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'credit.creditcourse': { - 'Meta': {'object_name': 'CreditCourse'}, - 'course_key': ('xmodule_django.models.CourseKeyField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - }, - 'credit.crediteligibility': { - 'Meta': {'unique_together': "(('username', 'course'),)", 'object_name': 'CreditEligibility'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'eligibilities'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'deadline': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2016, 7, 26, 0, 0)'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.creditprovider': { - 'Meta': {'object_name': 'CreditProvider'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'eligibility_email_message': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'enable_integration': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'fulfillment_instructions': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'provider_description': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'provider_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'provider_status_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'provider_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), - 'receipt_email_message': ('django.db.models.fields.TextField', [], {'default': "''"}), - 'thumbnail_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '255'}) - }, - 'credit.creditrequest': { - 'Meta': {'unique_together': "(('username', 'course', 'provider'),)", 'object_name': 'CreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requests'", 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}) - }, - 'credit.creditrequirement': { - 'Meta': {'ordering': "['order']", 'unique_together': "(('namespace', 'name', 'course'),)", 'object_name': 'CreditRequirement'}, - 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'credit_requirements'", 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'criteria': ('jsonfield.fields.JSONField', [], {}), - 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'namespace': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}) - }, - 'credit.creditrequirementstatus': { - 'Meta': {'unique_together': "(('username', 'requirement'),)", 'object_name': 'CreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'statuses'", 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequest': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequest'}, - 'course': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditCourse']"}), - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'parameters': ('jsonfield.fields.JSONField', [], {}), - 'provider': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditProvider']"}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - }, - 'credit.historicalcreditrequirementstatus': { - 'Meta': {'ordering': "(u'-history_date', u'-history_id')", 'object_name': 'HistoricalCreditRequirementStatus'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - u'history_date': ('django.db.models.fields.DateTimeField', [], {}), - u'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), - u'history_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), - 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'reason': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'requirement': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'+'", 'null': 'True', 'on_delete': 'models.DO_NOTHING', 'to': "orm['credit.CreditRequirement']"}), - 'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) - } - } - - complete_apps = ['credit'] diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index 378d8c20a2..af843b201c 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -443,7 +443,7 @@ class CreditRequirementStatus(TimeStampedModel): return cls.objects.filter(requirement__in=requirements, username=username) @classmethod - @transaction.commit_on_success + @transaction.atomic def add_or_update_requirement_status(cls, username, requirement, status="satisfied", reason=None): """ Add credit requirement status for given username. @@ -466,7 +466,7 @@ class CreditRequirementStatus(TimeStampedModel): requirement_status.save() @classmethod - @transaction.commit_on_success + @transaction.atomic def remove_requirement_status(cls, username, requirement): """ Remove credit requirement status for given username. @@ -490,6 +490,13 @@ class CreditRequirementStatus(TimeStampedModel): return +def default_deadline_for_credit_eligibility(): # pylint: disable=invalid-name + """ The default deadline to use when creating a new CreditEligibility model. """ + return datetime.datetime.now(pytz.UTC) + datetime.timedelta( + days=getattr(settings, "CREDIT_ELIGIBILITY_EXPIRATION_DAYS", 365) + ) + + class CreditEligibility(TimeStampedModel): """ A record of a user's eligibility for credit from a specific credit @@ -504,11 +511,7 @@ class CreditEligibility(TimeStampedModel): # We save the deadline as a database field just in case # we need to override the deadline for particular students. deadline = models.DateTimeField( - default=lambda: ( - datetime.datetime.now(pytz.UTC) + datetime.timedelta( - days=getattr(settings, "CREDIT_ELIGIBILITY_EXPIRATION_DAYS", 365) - ) - ), + default=default_deadline_for_credit_eligibility, help_text=ugettext_lazy("Deadline for purchasing and requesting credit.") ) diff --git a/openedx/core/djangoapps/credit/tests/test_api.py b/openedx/core/djangoapps/credit/tests/test_api.py index 3bd4da9823..5328bd03f6 100644 --- a/openedx/core/djangoapps/credit/tests/test_api.py +++ b/openedx/core/djangoapps/credit/tests/test_api.py @@ -427,7 +427,7 @@ class CreditRequirementApiTests(CreditApiTestBase): user = UserFactory.create(username=self.USER_INFO['username'], password=self.USER_INFO['password']) # Satisfy one of the requirements, but not the other - with self.assertNumQueries(7): + with self.assertNumQueries(11): api.set_credit_requirement_status( user.username, self.course_key, @@ -439,7 +439,7 @@ class CreditRequirementApiTests(CreditApiTestBase): self.assertFalse(api.is_user_eligible_for_credit("bob", self.course_key)) # Satisfy the other requirement - with self.assertNumQueries(11): + with self.assertNumQueries(15): api.set_credit_requirement_status( "bob", self.course_key, @@ -479,7 +479,7 @@ class CreditRequirementApiTests(CreditApiTestBase): # Delete the eligibility entries and satisfy the user's eligibility # requirement again to trigger eligibility notification CreditEligibility.objects.all().delete() - with self.assertNumQueries(12): + with self.assertNumQueries(13): api.set_credit_requirement_status( "bob", self.course_key, @@ -726,15 +726,16 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase): # - 2 queries: Get-or-create the credit request. # - 1 query: Retrieve user account and profile information from the user API. # - 1 query: Look up the user's final grade from the credit requirements table. - # - 2 queries: Update the request. + # - 1 query: Update the request. # - 2 queries: Update the history table for the request. - with self.assertNumQueries(10): + # - 4 Django savepoints + with self.assertNumQueries(13): request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO['username']) - # - 3 queries: Retrieve and update the request + # - 2 queries: Retrieve and update the request # - 1 query: Update the history table for the request. uuid = request["parameters"]["request_uuid"] - with self.assertNumQueries(4): + with self.assertNumQueries(3): api.update_credit_request_status(uuid, self.PROVIDER_ID, "approved") with self.assertNumQueries(1): @@ -771,11 +772,11 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase): api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO['username']) @ddt.data("pending", "failed") - def test_user_is_not_eligible(self, status): + def test_user_is_not_eligible(self, requirement_status): # Simulate a user who is not eligible for credit CreditEligibility.objects.all().delete() status = CreditRequirementStatus.objects.get(username=self.USER_INFO['username']) - status.status = status + status.status = requirement_status status.reason = {} status.save() @@ -810,7 +811,6 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase): # coerces None values to empty strings. query = "UPDATE auth_userprofile SET country = NULL WHERE id = %s" connection.cursor().execute(query, [str(self.user.profile.id)]) - transaction.commit_unless_managed() # Request should include an empty country field request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO["username"]) diff --git a/openedx/core/djangoapps/programs/migrations/0001_initial.py b/openedx/core/djangoapps/programs/migrations/0001_initial.py index 5bc39e7274..95554d04db 100644 --- a/openedx/core/djangoapps/programs/migrations/0001_initial.py +++ b/openedx/core/djangoapps/programs/migrations/0001_initial.py @@ -1,80 +1,33 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'ProgramsApiConfig' - db.create_table('programs_programsapiconfig', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('internal_service_url', self.gf('django.db.models.fields.URLField')(max_length=200)), - ('public_service_url', self.gf('django.db.models.fields.URLField')(max_length=200)), - ('api_version_number', self.gf('django.db.models.fields.IntegerField')()), - ('enable_student_dashboard', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('programs', ['ProgramsApiConfig']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'ProgramsApiConfig' - db.delete_table('programs_programsapiconfig') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'programs.programsapiconfig': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'ProgramsApiConfig'}, - 'api_version_number': ('django.db.models.fields.IntegerField', [], {}), - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enable_student_dashboard': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'internal_service_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), - 'public_service_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) - } - } - - complete_apps = ['programs'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='ProgramsApiConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('internal_service_url', models.URLField(verbose_name='Internal Service URL')), + ('public_service_url', models.URLField(verbose_name='Public Service URL')), + ('api_version_number', models.IntegerField(verbose_name='API Version')), + ('enable_student_dashboard', models.NullBooleanField(verbose_name='Enable Student Dashboard Displays')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/openedx/core/djangoapps/programs/models.py b/openedx/core/djangoapps/programs/models.py index bf866acdf0..4f7a8846c7 100644 --- a/openedx/core/djangoapps/programs/models.py +++ b/openedx/core/djangoapps/programs/models.py @@ -4,7 +4,7 @@ Models providing Programs support for the LMS and Studio. from urlparse import urljoin -from django.db.models import BooleanField, IntegerField, URLField +from django.db.models import NullBooleanField, IntegerField, URLField from django.utils.translation import ugettext_lazy as _ from django.db import models @@ -20,6 +20,7 @@ class ProgramsApiConfig(ConfigurationModel): internal_service_url = URLField(verbose_name=_("Internal Service URL")) public_service_url = URLField(verbose_name=_("Public Service URL")) api_version_number = IntegerField(verbose_name=_("API Version")) +<<<<<<< HEAD enable_student_dashboard = BooleanField(verbose_name=_("Enable Student Dashboard Displays")) cache_ttl = models.PositiveIntegerField( verbose_name=_("Cache Time To Live"), @@ -30,6 +31,9 @@ class ProgramsApiConfig(ConfigurationModel): ) PROGRAMS_API_CACHE_KEY = "programs.api.data" +======= + enable_student_dashboard = NullBooleanField(verbose_name=_("Enable Student Dashboard Displays")) +>>>>>>> origin/release @property def internal_api_url(self): diff --git a/openedx/core/djangoapps/self_paced/migrations/0001_initial.py b/openedx/core/djangoapps/self_paced/migrations/0001_initial.py index f683ec1115..e95596b041 100644 --- a/openedx/core/djangoapps/self_paced/migrations/0001_initial.py +++ b/openedx/core/djangoapps/self_paced/migrations/0001_initial.py @@ -1,72 +1,30 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'SelfPacedConfiguration' - db.create_table('self_paced_selfpacedconfiguration', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('change_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.PROTECT)), - ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('self_paced', ['SelfPacedConfiguration']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - - def backwards(self, orm): - # Deleting model 'SelfPacedConfiguration' - db.delete_table('self_paced_selfpacedconfiguration') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'self_paced.selfpacedconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'SelfPacedConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['self_paced'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='SelfPacedConfiguration', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('enable_course_home_improvements', models.BooleanField(default=False, verbose_name='Enable course home page improvements.')), + ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ), + ] diff --git a/openedx/core/djangoapps/self_paced/migrations/0002_auto__add_field_selfpacedconfiguration_enable_course_home_improvements.py b/openedx/core/djangoapps/self_paced/migrations/0002_auto__add_field_selfpacedconfiguration_enable_course_home_improvements.py deleted file mode 100644 index 6de0a78e70..0000000000 --- a/openedx/core/djangoapps/self_paced/migrations/0002_auto__add_field_selfpacedconfiguration_enable_course_home_improvements.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'SelfPacedConfiguration.enable_course_home_improvements' - db.add_column('self_paced_selfpacedconfiguration', 'enable_course_home_improvements', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'SelfPacedConfiguration.enable_course_home_improvements' - db.delete_column('self_paced_selfpacedconfiguration', 'enable_course_home_improvements') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'self_paced.selfpacedconfiguration': { - 'Meta': {'ordering': "('-change_date',)", 'object_name': 'SelfPacedConfiguration'}, - 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), - 'enable_course_home_improvements': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) - } - } - - complete_apps = ['self_paced'] \ No newline at end of file diff --git a/openedx/core/djangoapps/theming/core.py b/openedx/core/djangoapps/theming/core.py index 4d114dc3ef..45b8e33c1a 100644 --- a/openedx/core/djangoapps/theming/core.py +++ b/openedx/core/djangoapps/theming/core.py @@ -31,7 +31,7 @@ def comprehensive_theme_changes(theme_dir): templates_dir = theme_dir / "lms" / "templates" if templates_dir.isdir(): - changes['settings']['TEMPLATE_DIRS'] = [templates_dir] + settings.TEMPLATE_DIRS + changes['settings']['TEMPLATE_DIRS'] = [templates_dir] + settings.DEFAULT_TEMPLATE_ENGINE['DIRS'] changes['mako_paths'].append(templates_dir) staticfiles_dir = theme_dir / "lms" / "static" diff --git a/openedx/core/djangoapps/user_api/accounts/api.py b/openedx/core/djangoapps/user_api/accounts/api.py index d38726d946..fd9f6b8b5e 100644 --- a/openedx/core/djangoapps/user_api/accounts/api.py +++ b/openedx/core/djangoapps/user_api/accounts/api.py @@ -250,7 +250,7 @@ def _get_user_and_profile(username): @intercept_errors(UserAPIInternalError, ignore_errors=[UserAPIRequestError]) -@transaction.commit_on_success +@transaction.atomic def create_account(username, password, email): """Create a new user account. diff --git a/openedx/core/djangoapps/user_api/accounts/serializers.py b/openedx/core/djangoapps/user_api/accounts/serializers.py index 976706189d..c43b21e268 100644 --- a/openedx/core/djangoapps/user_api/accounts/serializers.py +++ b/openedx/core/djangoapps/user_api/accounts/serializers.py @@ -70,7 +70,11 @@ class UserReadOnlySerializer(serializers.Serializer): reverse('accounts_api', kwargs={'username': user.username}) ), "email": user.email, - "date_joined": user.date_joined, + # For backwards compatibility: Tables created after the upgrade to Django 1.8 will save microseconds. + # However, mobile apps are not expecting microsecond in the serialized value. If we set it to zero the + # DRF JSONEncoder will not include it in the serialized value. + # https://docs.djangoproject.com/en/1.8/ref/databases/#fractional-seconds-support-for-time-and-datetime-fields + "date_joined": user.date_joined.replace(microsecond=0), "is_active": user.is_active, "bio": AccountLegacyProfileSerializer.convert_empty_to_None(profile.bio), "country": AccountLegacyProfileSerializer.convert_empty_to_None(profile.country.code), diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py index f58e1a03ab..db086759e8 100644 --- a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py +++ b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py @@ -313,7 +313,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase): '@domain.com', 'test@no_extension', u'fŕáńḱ@example.com', - u'frank@éxáḿṕĺé.ćőḿ', # Long email -- subtract the length of the @domain # except for one character (so we exceed the max length limit) diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_views.py b/openedx/core/djangoapps/user_api/accounts/tests/test_views.py index 7578eb46a7..d19662827f 100644 --- a/openedx/core/djangoapps/user_api/accounts/tests/test_views.py +++ b/openedx/core/djangoapps/user_api/accounts/tests/test_views.py @@ -2,8 +2,9 @@ """ Test cases to cover Accounts-related behaviors of the User API application """ -import datetime +from collections import OrderedDict from copy import deepcopy +import datetime import ddt import hashlib import json @@ -239,7 +240,7 @@ class TestAccountAPI(UserAPITestCase): """ self.different_client.login(username=self.different_user.username, password=self.test_password) self.create_mock_profile(self.user) - with self.assertNumQueries(9): + with self.assertNumQueries(11): response = self.send_get(self.different_client) self._verify_full_shareable_account_response(response, account_privacy=ALL_USERS_VISIBILITY) @@ -254,7 +255,7 @@ class TestAccountAPI(UserAPITestCase): """ self.different_client.login(username=self.different_user.username, password=self.test_password) self.create_mock_profile(self.user) - with self.assertNumQueries(9): + with self.assertNumQueries(11): response = self.send_get(self.different_client) self._verify_private_account_response(response, account_privacy=PRIVATE_VISIBILITY) @@ -305,7 +306,11 @@ class TestAccountAPI(UserAPITestCase): """ Internal helper to perform the actual assertions """ +<<<<<<< HEAD with self.assertNumQueries(7): +======= + with self.assertNumQueries(10): +>>>>>>> origin/release response = self.send_get(self.client) data = response.data self.assertEqual(16, len(data)) @@ -344,7 +349,11 @@ class TestAccountAPI(UserAPITestCase): legacy_profile.save() self.client.login(username=self.user.username, password=self.test_password) +<<<<<<< HEAD with self.assertNumQueries(7): +======= + with self.assertNumQueries(10): +>>>>>>> origin/release response = self.send_get(self.client) for empty_field in ("level_of_education", "gender", "country", "bio"): self.assertIsNone(response.data[empty_field]) @@ -383,14 +392,14 @@ class TestAccountAPI(UserAPITestCase): ("level_of_education", "none", u"ȻħȺɍłɇs", u'"ȻħȺɍłɇs" is not a valid choice.'), ("country", "GB", "XY", u'"XY" is not a valid choice.'), ("year_of_birth", 2009, "not_an_int", u"A valid integer is required."), - ("name", "bob", "z" * 256, u"Ensure this field has no more than 255 characters."), - ("name", u"ȻħȺɍłɇs", "z ", u"The name field must be at least 2 characters long."), + ("name", "bob", "z" * 256, u"Ensure this value has at most 255 characters (it has 256)."), + ("name", u"ȻħȺɍłɇs", "z ", "The name field must be at least 2 characters long."), ("goals", "Smell the roses"), ("mailing_address", "Sesame Street"), # Note that we store the raw data, so it is up to client to escape the HTML. ( "bio", u"Lacrosse-playing superhero 壓是進界推日不復女", - "z" * 3001, u"Ensure this field has no more than 3000 characters." + "z" * 3001, u"Ensure this value has at most 3000 characters (it has 3001)." ), ("account_privacy", ALL_USERS_VISIBILITY), ("account_privacy", PRIVATE_VISIBILITY), @@ -604,11 +613,14 @@ class TestAccountAPI(UserAPITestCase): @ddt.data( (u"not_a_list", {u'non_field_errors': [u'Expected a list of items but got type "unicode".']}), ([u"not_a_JSON_object"], [{u'non_field_errors': [u'Invalid data. Expected a dictionary, but got unicode.']}]), - ([{}], [{"code": [u"This field is required."]}]), - ([{u"code": u"invalid_language_code"}], [{'code': [u'"invalid_language_code" is not a valid choice.']}]), + ([{}], [OrderedDict([('code', [u'This field is required.'])])]), + ( + [{u"code": u"invalid_language_code"}], + [OrderedDict([('code', [u'"invalid_language_code" is not a valid choice.'])])] + ), ( [{u"code": u"kw"}, {u"code": u"el"}, {u"code": u"kw"}], - [u'The language_proficiencies field must consist of unique languages'] + ['The language_proficiencies field must consist of unique languages'] ), ) @ddt.unpack diff --git a/openedx/core/djangoapps/user_api/accounts/views.py b/openedx/core/djangoapps/user_api/accounts/views.py index 1d6250ea5d..01044db32c 100644 --- a/openedx/core/djangoapps/user_api/accounts/views.py +++ b/openedx/core/djangoapps/user_api/accounts/views.py @@ -162,7 +162,7 @@ class AccountView(APIView): else an error response with status code 415 will be returned. """ try: - with transaction.commit_on_success(): + with transaction.atomic(): update_account_settings(request.user, request.data, username=username) account_settings = get_account_settings(request, username) except UserNotAuthorized: diff --git a/openedx/core/djangoapps/user_api/migrations/0001_initial.py b/openedx/core/djangoapps/user_api/migrations/0001_initial.py index 3a5e3c0ab5..2945733921 100644 --- a/openedx/core/djangoapps/user_api/migrations/0001_initial.py +++ b/openedx/core/djangoapps/user_api/migrations/0001_initial.py @@ -1,78 +1,62 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +from django.conf import settings +import model_utils.fields +import django.core.validators +import xmodule_django.models -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'UserPreference' - db.create_table('user_api_userpreference', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), - ('key', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('user_api', ['UserPreference']) + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] - # Adding unique constraint on 'UserPreference', fields ['user', 'key'] - db.create_unique('user_api_userpreference', ['user_id', 'key']) - - - def backwards(self, orm): - # Removing unique constraint on 'UserPreference', fields ['user', 'key'] - db.delete_unique('user_api_userpreference', ['user_id', 'key']) - - # Deleting model 'UserPreference' - db.delete_table('user_api_userpreference') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'user_api.userpreference': { - 'Meta': {'unique_together': "(('user', 'key'),)", 'object_name': 'UserPreference'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - } - } - - complete_apps = ['user_api'] + operations = [ + migrations.CreateModel( + name='UserCourseTag', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('key', models.CharField(max_length=255, db_index=True)), + ('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), + ('value', models.TextField()), + ('user', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='UserOrgTag', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), + ('key', models.CharField(max_length=255, db_index=True)), + ('org', models.CharField(max_length=255, db_index=True)), + ('value', models.TextField()), + ('user', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='UserPreference', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('key', models.CharField(db_index=True, max_length=255, validators=[django.core.validators.RegexValidator(b'[-_a-zA-Z0-9]+')])), + ('value', models.TextField()), + ('user', models.ForeignKey(related_name='preferences', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AlterUniqueTogether( + name='userpreference', + unique_together=set([('user', 'key')]), + ), + migrations.AlterUniqueTogether( + name='userorgtag', + unique_together=set([('user', 'org', 'key')]), + ), + migrations.AlterUniqueTogether( + name='usercoursetag', + unique_together=set([('user', 'course_id', 'key')]), + ), + ] diff --git a/openedx/core/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py b/openedx/core/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py deleted file mode 100644 index 639fb83e9c..0000000000 --- a/openedx/core/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'UserCourseTags' - db.create_table('user_api_usercoursetags', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), - ('key', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('user_api', ['UserCourseTags']) - - # Adding unique constraint on 'UserCourseTags', fields ['user', 'course_id', 'key'] - db.create_unique('user_api_usercoursetags', ['user_id', 'course_id', 'key']) - - - def backwards(self, orm): - # Removing unique constraint on 'UserCourseTags', fields ['user', 'course_id', 'key'] - db.delete_unique('user_api_usercoursetags', ['user_id', 'course_id', 'key']) - - # Deleting model 'UserCourseTags' - db.delete_table('user_api_usercoursetags') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'user_api.usercoursetags': { - 'Meta': {'unique_together': "(('user', 'course_id', 'key'),)", 'object_name': 'UserCourseTags'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - }, - 'user_api.userpreference': { - 'Meta': {'unique_together': "(('user', 'key'),)", 'object_name': 'UserPreference'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - } - } - - complete_apps = ['user_api'] diff --git a/openedx/core/djangoapps/user_api/migrations/0003_rename_usercoursetags.py b/openedx/core/djangoapps/user_api/migrations/0003_rename_usercoursetags.py deleted file mode 100644 index 9c9afc3044..0000000000 --- a/openedx/core/djangoapps/user_api/migrations/0003_rename_usercoursetags.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - db.rename_table('user_api_usercoursetags', 'user_api_usercoursetag') - - - def backwards(self, orm): - db.rename_table('user_api_usercoursetag', 'user_api_usercoursetags') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'user_api.usercoursetag': { - 'Meta': {'unique_together': "(('user', 'course_id', 'key'),)", 'object_name': 'UserCourseTag'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - }, - 'user_api.userpreference': { - 'Meta': {'unique_together': "(('user', 'key'),)", 'object_name': 'UserPreference'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - } - } - - complete_apps = ['user_api'] diff --git a/openedx/core/djangoapps/user_api/migrations/0004_auto__add_userorgtag__add_unique_userorgtag_user_org_key__chg_field_us.py b/openedx/core/djangoapps/user_api/migrations/0004_auto__add_userorgtag__add_unique_userorgtag_user_org_key__chg_field_us.py deleted file mode 100644 index 8ea25eb60f..0000000000 --- a/openedx/core/djangoapps/user_api/migrations/0004_auto__add_userorgtag__add_unique_userorgtag_user_org_key__chg_field_us.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'UserOrgTag' - db.create_table('user_api_userorgtag', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)), - ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), - ('key', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('org', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), - ('value', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('user_api', ['UserOrgTag']) - - # Adding unique constraint on 'UserOrgTag', fields ['user', 'org', 'key'] - db.create_unique('user_api_userorgtag', ['user_id', 'org', 'key']) - - # Create a composite index of user_id, org, and key. - db.create_index('user_api_userorgtag', ['user_id', 'org', 'key']) - - # Changing field 'UserCourseTag.course_id' - db.alter_column('user_api_usercoursetag', 'course_id', self.gf('xmodule_django.models.CourseKeyField')(max_length=255)) - - def backwards(self, orm): - - # Delete the composite index of user_id, org, and key. - db.delete_index('user_api_userorgtag', ['user_id', 'org', 'key']) - - # Removing unique constraint on 'UserOrgTag', fields ['user', 'org', 'key'] - db.delete_unique('user_api_userorgtag', ['user_id', 'org', 'key']) - - # Deleting model 'UserOrgTag' - db.delete_table('user_api_userorgtag') - - # Changing field 'UserCourseTag.course_id' - db.alter_column('user_api_usercoursetag', 'course_id', self.gf('django.db.models.fields.CharField')(max_length=255)) - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'user_api.usercoursetag': { - 'Meta': {'unique_together': "(('user', 'course_id', 'key'),)", 'object_name': 'UserCourseTag'}, - 'course_id': ('xmodule_django.models.CourseKeyField', [], {'max_length': '255', 'db_index': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - }, - 'user_api.userorgtag': { - 'Meta': {'unique_together': "(('user', 'org', 'key'),)", 'object_name': 'UserOrgTag'}, - 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), - 'org': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - }, - 'user_api.userpreference': { - 'Meta': {'unique_together': "(('user', 'key'),)", 'object_name': 'UserPreference'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['auth.User']"}), - 'value': ('django.db.models.fields.TextField', [], {}) - } - } - - complete_apps = ['user_api'] diff --git a/openedx/core/djangoapps/user_api/preferences/tests/test_api.py b/openedx/core/djangoapps/user_api/preferences/tests/test_api.py index f8bc76e9ab..2bdc1680bd 100644 --- a/openedx/core/djangoapps/user_api/preferences/tests/test_api.py +++ b/openedx/core/djangoapps/user_api/preferences/tests/test_api.py @@ -436,7 +436,7 @@ def get_expected_validation_developer_message(preference_key, preference_value): preference_key=preference_key, preference_value=preference_value, error={ - "key": [u"Ensure this field has no more than 255 characters."] + "key": [u"Ensure this value has at most 255 characters (it has 256)."] } ) diff --git a/openedx/core/djangoapps/user_api/preferences/views.py b/openedx/core/djangoapps/user_api/preferences/views.py index 7a4649e36c..7594f5345c 100644 --- a/openedx/core/djangoapps/user_api/preferences/views.py +++ b/openedx/core/djangoapps/user_api/preferences/views.py @@ -117,7 +117,7 @@ class PreferencesView(APIView): status=status.HTTP_400_BAD_REQUEST ) try: - with transaction.commit_on_success(): + with transaction.atomic(): update_user_preferences(request.user, request.data, user=username) except UserNotAuthorized: return Response(status=status.HTTP_403_FORBIDDEN) diff --git a/openedx/core/lib/django_test_client_utils.py b/openedx/core/lib/django_test_client_utils.py index e48c502550..d6c2b8e5db 100644 --- a/openedx/core/lib/django_test_client_utils.py +++ b/openedx/core/lib/django_test_client_utils.py @@ -1,59 +1,10 @@ """ -This file includes the monkey-patch for requests' PATCH method, as we are using -older version of django that does not contains the PATCH method in its test client. +This file includes util methods. """ # pylint: disable=protected-access -from __future__ import unicode_literals - -from urlparse import urlparse - -from django.test.client import RequestFactory, Client, FakePayload - - -BOUNDARY = 'BoUnDaRyStRiNg' -MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY - - -def request_factory_patch(self, path, data=None, content_type=MULTIPART_CONTENT, **extra): - """ - Construct a PATCH request. - """ - # pylint: disable=invalid-name - - patch_data = self._encode_data(data or {}, content_type) - - parsed = urlparse(path) - r = { - 'CONTENT_LENGTH': len(patch_data), - 'CONTENT_TYPE': content_type, - 'PATH_INFO': self._get_path(parsed), - 'QUERY_STRING': parsed[4], - 'REQUEST_METHOD': 'PATCH', - 'wsgi.input': FakePayload(patch_data), - } - r.update(extra) - return self.request(**r) - - -def client_patch(self, path, data=None, content_type=MULTIPART_CONTENT, follow=False, **extra): - """ - Send a resource to the server using PATCH. - """ - response = super(Client, self).patch(path, data=data or {}, content_type=content_type, **extra) - if follow: - response = self._handle_redirects(response, **extra) - return response - - -if not hasattr(RequestFactory, 'patch'): - setattr(RequestFactory, 'patch', request_factory_patch) - -if not hasattr(Client, 'patch'): - setattr(Client, 'patch', client_patch) - def get_absolute_url(path): """ Generate an absolute URL for a resource on the test server. """ - return u'http://testserver/{}'.format(path.lstrip('/')) + return u'http://testserver/{}'.format(path.lstrip(u'/')) diff --git a/pavelib/assets.py b/pavelib/assets.py index cabd6e515e..eac7756b31 100644 --- a/pavelib/assets.py +++ b/pavelib/assets.py @@ -110,8 +110,8 @@ class SassWatcher(PatternMatchingEventHandler): def on_modified(self, event): print('\tCHANGED:', event.src_path) try: - compile_sass() - except Exception: # pylint: disable=broad-except + compile_sass() # pylint: disable=no-value-for-parameter + except Exception: # pylint: disable=broad-except traceback.print_exc() diff --git a/pavelib/docs.py b/pavelib/docs.py index 1e8957ad7b..0b10b61286 100644 --- a/pavelib/docs.py +++ b/pavelib/docs.py @@ -4,7 +4,8 @@ Ties into Sphinx to generate files at the specified location(s) """ from __future__ import print_function import sys -from paver.easy import * + +from paver.easy import cmdopts, needs, sh, task DOC_PATHS = { diff --git a/pavelib/js_test.py b/pavelib/js_test.py index d381374009..fb1a8933e6 100644 --- a/pavelib/js_test.py +++ b/pavelib/js_test.py @@ -61,7 +61,7 @@ def test_js_run(options): """ Run the JavaScript tests and print results to the console """ - setattr(options, 'mode', 'run') + options.mode = 'run' test_js(options) @@ -74,5 +74,5 @@ def test_js_dev(options): """ Run the JavaScript tests in your default browsers """ - setattr(options, 'mode', 'dev') + options.mode = 'dev' test_js(options) diff --git a/pavelib/paver_tests/test_servers.py b/pavelib/paver_tests/test_servers.py index 95c1c0ef69..9d75e57ce2 100644 --- a/pavelib/paver_tests/test_servers.py +++ b/pavelib/paver_tests/test_servers.py @@ -158,7 +158,7 @@ class TestPaverServerTasks(PaverTestCase): """ settings = options.get("settings", "devstack") call_task("pavelib.servers.update_db", options=options) - db_command = "python manage.py {server} --settings={settings} syncdb --migrate --traceback --pythonpath=." + db_command = "python manage.py {server} --settings={settings} migrate --traceback --pythonpath=." self.assertEquals( self.task_messages, [ diff --git a/pavelib/prereqs.py b/pavelib/prereqs.py index 1807491961..eb04404e31 100644 --- a/pavelib/prereqs.py +++ b/pavelib/prereqs.py @@ -2,14 +2,17 @@ Install Python, Ruby, and Node prerequisites. """ -import os -import hashlib from distutils import sysconfig -from paver.easy import * +import hashlib +import os + +from paver.easy import sh, task + from .utils.envs import Env +import sys -PREREQS_MD5_DIR = os.getenv('PREREQ_CACHE_DIR', Env.REPO_ROOT / '.prereqs_cache') +PREREQS_STATE_DIR = os.getenv('PREREQ_CACHE_DIR', Env.REPO_ROOT / '.prereqs_cache') NPM_REGISTRY = "http://registry.npmjs.org/" NO_PREREQ_MESSAGE = "NO_PREREQ_INSTALL is set, not installing prereqs" @@ -86,7 +89,7 @@ def prereq_cache(cache_name, paths, install_func): """ # Retrieve the old hash cache_filename = cache_name.replace(" ", "_") - cache_file_path = os.path.join(PREREQS_MD5_DIR, "{}.sha1".format(cache_filename)) + cache_file_path = os.path.join(PREREQS_STATE_DIR, "{}.sha1".format(cache_filename)) old_hash = None if os.path.isfile(cache_file_path): with open(cache_file_path) as cache_file: @@ -103,9 +106,9 @@ def prereq_cache(cache_name, paths, install_func): # If the code executed within the context fails (throws an exception), # then this step won't get executed. try: - os.makedirs(PREREQS_MD5_DIR) + os.makedirs(PREREQS_STATE_DIR) except OSError: - if not os.path.isdir(PREREQS_MD5_DIR): + if not os.path.isdir(PREREQS_STATE_DIR): raise with open(cache_file_path, "w") as cache_file: @@ -166,16 +169,90 @@ def install_node_prereqs(): prereq_cache("Node prereqs", ["package.json"], node_prereqs_installation) +@task +def uninstall_python_packages(): + """ + Uninstall Python packages that need explicit uninstallation. + + Some Python packages that we no longer want need to be explicitly + uninstalled, notably, South. Some other packages were once installed in + ways that were resistant to being upgraded, like edxval. Also uninstall + them. + + """ + # So that we don't constantly uninstall things, use a version number of the + # uninstallation needs. Check it, and skip this if we're up to date. + expected_version = 2 + state_file_path = os.path.join(PREREQS_STATE_DIR, "python_uninstall_version.txt") + if os.path.isfile(state_file_path): + with open(state_file_path) as state_file: + version = int(state_file.read()) + if version == expected_version: + return + + # Run pip to find the packages we need to get rid of. Believe it or not, + # edx-val is installed in a way that it is present twice, so we have a loop + # to really really get rid of it. + for _ in range(3): + uninstalled = False + frozen = sh("pip freeze", capture=True).splitlines() + + # Uninstall South + if any(line.startswith("South") for line in frozen): + sh("pip uninstall -y South") + uninstalled = True + + # Uninstall edx-val + if any("edxval" in line for line in frozen): + sh("pip uninstall -y edxval") + uninstalled = True + + # Uninstall django-storages + if any("django-storages==" in line for line in frozen): + sh("pip uninstall -y django-storages") + uninstalled = True + + if not uninstalled: + break + else: + # We tried three times and didn't manage to get rid of the pests. + print "Couldn't uninstall unwanted Python packages!" + return + + # Write our version. + with open(state_file_path, "w") as state_file: + state_file.write(str(expected_version)) + + @task def install_python_prereqs(): """ - Installs Python prerequisites + Installs Python prerequisites. """ if no_prereq_install(): print NO_PREREQ_MESSAGE return - prereq_cache("Python prereqs", PYTHON_REQ_FILES + [sysconfig.get_python_lib()], python_prereqs_installation) + # Include all of the requirements files in the fingerprint. + files_to_fingerprint = list(PYTHON_REQ_FILES) + + # Also fingerprint the directories where packages get installed: + # ("/edx/app/edxapp/venvs/edxapp/lib/python2.7/site-packages") + files_to_fingerprint.append(sysconfig.get_python_lib()) + + # In a virtualenv, "-e installs" get put in a src directory. + src_dir = os.path.join(sys.prefix, "src") + if os.path.isdir(src_dir): + files_to_fingerprint.append(src_dir) + + # Also fingerprint this source file, so that if the logic for installations + # changes, we will redo the installation. + this_file = __file__ + if this_file.endswith(".pyc"): + this_file = this_file[:-1] # use the .py file instead of the .pyc + files_to_fingerprint.append(this_file) + + prereq_cache("Python prereqs", files_to_fingerprint, python_prereqs_installation) @task @@ -189,4 +266,5 @@ def install_prereqs(): install_ruby_prereqs() install_node_prereqs() + uninstall_python_packages() install_python_prereqs() diff --git a/pavelib/servers.py b/pavelib/servers.py index 3fd3c335b0..f76fdf906a 100644 --- a/pavelib/servers.py +++ b/pavelib/servers.py @@ -3,7 +3,9 @@ Run and manage servers for local development. """ from __future__ import print_function import argparse -from paver.easy import * +import sys + +from paver.easy import call_task, cmdopts, consume_args, needs, sh, task from .assets import collect_assets from .utils.cmd import django_cmd @@ -233,14 +235,16 @@ def run_all_servers(options): @needs('pavelib.prereqs.install_prereqs') @cmdopts([ ("settings=", "s", "Django settings"), + ("fake-initial", None, "Fake the initial migrations"), ]) -def update_db(): +def update_db(options): """ Runs syncdb and then migrate. """ settings = getattr(options, 'settings', DEFAULT_SETTINGS) + fake = "--fake-initial" if getattr(options, 'fake_initial', False) else "" for system in ('lms', 'cms'): - sh(django_cmd(system, settings, 'syncdb', '--migrate', '--traceback', '--pythonpath=.')) + sh(django_cmd(system, settings, 'migrate', fake, '--traceback', '--pythonpath=.')) @task diff --git a/pavelib/utils/cmd.py b/pavelib/utils/cmd.py index 07f9befc47..9bad153f46 100644 --- a/pavelib/utils/cmd.py +++ b/pavelib/utils/cmd.py @@ -7,7 +7,7 @@ def cmd(*args): """ Concatenate the arguments into a space-separated shell command. """ - return " ".join([str(arg) for arg in args]) + return " ".join(str(arg) for arg in args if arg) def django_cmd(sys, settings, *args): diff --git a/pavelib/utils/test/suites/acceptance_suite.py b/pavelib/utils/test/suites/acceptance_suite.py index b9b6447444..631dab98ce 100644 --- a/pavelib/utils/test/suites/acceptance_suite.py +++ b/pavelib/utils/test/suites/acceptance_suite.py @@ -130,8 +130,6 @@ class AcceptanceTestSuite(TestSuite): sh("./manage.py cms --settings acceptance migrate --traceback --noinput") else: # If no cached database exists, syncdb before migrating, then create the cache - sh("./manage.py lms --settings acceptance syncdb --traceback --noinput") - sh("./manage.py cms --settings acceptance syncdb --traceback --noinput") sh("./manage.py lms --settings acceptance migrate --traceback --noinput") sh("./manage.py cms --settings acceptance migrate --traceback --noinput") diff --git a/pavelib/utils/test/suites/bokchoy_suite.py b/pavelib/utils/test/suites/bokchoy_suite.py index 2c73597a9b..6591b84951 100644 --- a/pavelib/utils/test/suites/bokchoy_suite.py +++ b/pavelib/utils/test/suites/bokchoy_suite.py @@ -66,7 +66,7 @@ class BokChoyTestSuite(TestSuite): self.log_dir.makedirs_p() self.har_dir.makedirs_p() self.report_dir.makedirs_p() - test_utils.clean_reports_dir() + test_utils.clean_reports_dir() # pylint: disable=no-value-for-parameter if not (self.fasttest or self.skip_clean): test_utils.clean_test_files() diff --git a/pavelib/utils/test/suites/nose_suite.py b/pavelib/utils/test/suites/nose_suite.py index 7531ebf48f..ae739ba12c 100644 --- a/pavelib/utils/test/suites/nose_suite.py +++ b/pavelib/utils/test/suites/nose_suite.py @@ -120,7 +120,7 @@ class SystemTestSuite(NoseTestSuite): def cmd(self): cmd = ( './manage.py {system} test --verbosity={verbosity} ' - '{test_id} {test_opts} --traceback --settings=test {extra} ' + '{test_id} {test_opts} --settings=test {extra} ' '--with-xunit --xunit-file={xunit_report}'.format( system=self.root, verbosity=self.verbosity, diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 55e2e0e8f0..64e2926559 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -13,23 +13,25 @@ celery==3.1.18 cssselect==0.9.1 dealer==2.0.4 defusedxml==0.4.1 -django-babel-underscore==0.3.0 +django-babel-underscore==0.4.2 django-celery==3.1.16 django-countries==3.3 -django-extensions==1.5.5 +django-extensions==1.5.9 django-filter==0.11.0 django-ipware==1.1.0 django-mako==0.1.5pre django-model-utils==2.3.1 django-mptt==0.7.4 -django-openid-auth==0.4 +django-oauth-plus==2.2.8 django-sekizai==0.8.2 django-ses==0.7.0 django-simple-history==1.6.3 -django-storages==1.1.5 +django-storages-redux==1.3 django-method-override==0.1.0 -djangorestframework>=3.1,<3.2 -django==1.4.22 +# We need a fix to DRF 3.2.x, for now use it from our own cherry-picked repo +#djangorestframework>=3.1,<3.2 +git+https://github.com/edx/django-rest-framework.git@3c72cb5ee5baebc4328947371195eae2077197b0#egg=djangorestframework==3.2.3 +django==1.8.5 edx-rest-api-client==1.2.1 elasticsearch==0.4.5 facebook-sdk==0.4.0 @@ -63,7 +65,11 @@ pyparsing==2.0.1 python-memcached==1.48 python-openid==2.2.5 python-dateutil==2.1 + +# This module gets monkey-patched in third_party_auth.py to fix a Django 1.8 incompatibility. +# When this dependency gets upgraded, the monkey patch should be removed, if possible. python-social-auth==0.2.12 + pytz==2015.2 pysrt==0.4.7 PyYAML==3.10 @@ -74,7 +80,6 @@ Shapely==1.2.16 singledispatch==3.4.0.2 sorl-thumbnail==12.3 sortedcontainers==0.9.2 -South==1.0.1 stevedore==0.14.1 sure==1.2.3 sympy==0.7.1 diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 3487466163..1415d23720 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -9,16 +9,17 @@ # Third-party: -e git+https://github.com/cyberdelia/django-pipeline.git@1.5.3#egg=django-pipeline --e git+https://github.com/edx/django-wiki.git@cd0b2b31997afccde519fe5b3365e61a9edb143f#egg=django-wiki --e git+https://github.com/edx/django-oauth2-provider.git@0.2.7-fork-edx-5#egg=django-oauth2-provider --e git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth --e git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=mongodb_proxy +git+https://github.com/edx/django-wiki.git@ned/dj18#egg=django-wiki==0.0.4 +-e git+https://github.com/edx/django-oauth2-provider.git@will/django-1.8-upgrade#egg=django-oauth2-provider==0.2.7-fork-edx-6 +git+https://github.com/edx/django-openid-auth.git@django1.8-upgrade#egg=django-openid-auth==0.8 +-e git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth==1.0.1 +git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0 git+https://github.com/edx/nltk.git@2.0.6#egg=nltk==2.0.6 -e git+https://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev -e git+https://github.com/eventbrite/zendesk.git@d53fe0e81b623f084e91776bcf6369f8b7b63879#egg=zendesk -e git+https://github.com/appliedsec/pygeoip.git@95e69341cebf5a6a9fbf7c4f5439d458898bdc3b#egg=pygeoip -e git+https://github.com/jazkarta/edx-jsme.git@c5bfa5d361d6685d8c643838fc0055c25f8b7999#egg=edx-jsme --e git+https://github.com/pmitros/django-pyfs.git@d175715e0fe3367ec0f1ee429c242d603f6e8b10#egg=djpyfs +git+https://github.com/edx/django-pyfs.git@ned/update-django-18#egg=django-pyfs==1.0.3 git+https://github.com/mitocw/django-cas.git@60a5b8e5a62e63e0d5d224a87f0b489201a0c695#egg=django-cas -e git+https://github.com/dgrtwo/ParsePy.git@7949b9f754d1445eff8e8f20d0e967b9a6420639#egg=parse_rest # Master pyfs has a bug working with VPC auth. This is a fix. We should switch @@ -31,35 +32,40 @@ git+https://github.com/hmarr/django-debug-toolbar-mongo.git@b0686a76f1ce3532088c -e git+https://github.com/jazkarta/ccx-keys.git@e6b03704b1bb97c1d2f31301ecb4e3a687c536ea#egg=ccx-keys git+https://github.com/edx/rfc6266.git@v0.0.5-edx#egg=rfc6266==0.0.5-edx # Used for testing --e git+https://github.com/gabrielfalcao/lettuce.git@b18b8fb711eb7a178c58574716032ad8de525912#egg=lettuce=1.8-support +git+https://github.com/edx/lettuce.git@django1.8/upgrade#egg=lettuce==0.2.20.002 # Our libraries: --e git+https://github.com/edx/XBlock.git@a20c70f2e3df1cb716b9c7a25fecf57020543b7f#egg=XBlock +-e git+https://github.com/edx/XBlock.git@django1.8-upgrade#egg=XBlock -e git+https://github.com/edx/codejail.git@6b17c33a89bef0ac510926b1d7fea2748b73aadd#egg=codejail -e git+https://github.com/edx/js-test-tool.git@v0.1.6#egg=js_test_tool --e git+https://github.com/edx/event-tracking.git@0.2.0#egg=event-tracking --e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash +-e git+https://github.com/edx/event-tracking.git@django1.8-upgrade#egg=event-tracking==0.2.1 +-e git+https://github.com/edx/django-splash.git@ammar/upgrade-to-django1.8#egg=django-splash==0.2 -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock --e git+https://github.com/edx/edx-ora2.git@release-2015-09-22T15.43#egg=edx-ora2 --e git+https://github.com/edx/edx-submissions.git@0.1.0#egg=edx-submissions +-e git+https://github.com/edx/edx-ora2.git@mzfr/django18-from-release#egg=ora2==0.2.2 +-e git+https://github.com/edx/edx-submissions.git@django-upgrade/1.8#egg=edx-submissions==0.1.2 -e git+https://github.com/edx/opaque-keys.git@27dc382ea587483b1e3889a3d19cbd90b9023a06#egg=opaque-keys git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3 git+https://github.com/edx/i18n-tools.git@v0.1.3#egg=i18n-tools==v0.1.3 -git+https://github.com/edx/edx-oauth2-provider.git@0.5.7#egg=edx-oauth2-provider==0.5.7 --e git+https://github.com/edx/edx-val.git@0.0.6#egg=edx-val +git+https://github.com/edx/edx-oauth2-provider.git@django1.8-upgrade#egg=edx-oauth2-provider==0.5.8 +git+https://github.com/edx/edx-val.git@ammar/upgrade-django-1.8#egg=edxval==0.0.8 -e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock -e git+https://github.com/pmitros/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock --e git+https://github.com/edx/edx-search.git@release-2015-09-11a#egg=edx-search -git+https://github.com/edx/edx-milestones.git@release-2015-10-20#egg=edx-milestones==0.1.3 +-e git+https://github.com/edx/edx-search.git@ammar/upgrade-django-1.8#egg=edx-search==0.1.1 +-e git+https://github.com/edx/edx-milestones.git@django1.8-upgrade#egg=edx-milestones==0.1.5 git+https://github.com/edx/edx-lint.git@v0.3.2#egg=edx_lint==0.3.2 -e git+https://github.com/edx/xblock-utils.git@213a97a50276d6a2504d8133650b2930ead357a0#egg=xblock-utils -e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive -git+https://github.com/edx/edx-reverification-block.git@0.0.4#egg=edx-reverification-block==0.0.4 +-e git+https://github.com/edx/edx-reverification-block.git@ned/upgrade-django-1.8#egg=edx-reverification-block==0.0.5 -e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client +<<<<<<< HEAD git+https://github.com/edx/edx-organizations.git@release-2015-11-17#egg=edx-organizations==0.1.7 git+https://github.com/edx/edx-proctoring.git@0.10.20#egg=edx-proctoring==0.10.20 +======= +git+https://github.com/edx/edx-organizations.git@ned/django-18#egg=edx-organizations==0.1.7 +git+https://github.com/edx/edx-proctoring.git@django1.8-upgrade#egg=edx-proctoring==0.11.2 +>>>>>>> origin/release # Third Party XBlocks -e git+https://github.com/mitodl/edx-sga@172a90fd2738f8142c10478356b2d9ed3e55334a#egg=edx-sga diff --git a/scripts/reset-test-db.sh b/scripts/reset-test-db.sh index 102e7f367c..6fef34aeba 100755 --- a/scripts/reset-test-db.sh +++ b/scripts/reset-test-db.sh @@ -48,13 +48,11 @@ else rm -rf $DB_CACHE_DIR && mkdir -p $DB_CACHE_DIR # Re-run migrations on the test database - ./manage.py lms --settings bok_choy syncdb --traceback --noinput - ./manage.py cms --settings bok_choy syncdb --traceback --noinput ./manage.py lms --settings bok_choy migrate --traceback --noinput ./manage.py cms --settings bok_choy migrate --traceback --noinput # Dump the schema and data to the cache - ./manage.py lms --settings bok_choy dumpdata > $DB_CACHE_DIR/bok_choy_data.json - mysqldump -u root --no-data --skip-comments --skip-dump-date edxtest > $DB_CACHE_DIR/bok_choy_schema.sql + # ./manage.py lms --settings bok_choy dumpdata > $DB_CACHE_DIR/bok_choy_data.json + # mysqldump -u root --no-data --skip-comments --skip-dump-date edxtest > $DB_CACHE_DIR/bok_choy_schema.sql fi