diff --git a/common/djangoapps/student/migrations/0010_auto_20170207_0458.py b/common/djangoapps/student/migrations/0010_auto_20170207_0458.py new file mode 100644 index 0000000000..2e29aff231 --- /dev/null +++ b/common/djangoapps/student/migrations/0010_auto_20170207_0458.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('student', '0009_auto_20170111_0422'), + ] + + operations = [ + migrations.RunSQL( + "create unique index email on auth_user (email);", + "drop index email on auth_user;" + ) + ] diff --git a/openedx/core/lib/django_courseware_routers.py b/openedx/core/lib/django_courseware_routers.py index 4665efe47f..ea3a290725 100644 --- a/openedx/core/lib/django_courseware_routers.py +++ b/openedx/core/lib/django_courseware_routers.py @@ -45,13 +45,15 @@ class StudentModuleHistoryExtendedRouter(object): return False return None - def allow_migrate(self, db, model): # pylint: disable=unused-argument + def allow_migrate(self, db, app_label, model_name=None, **hints): # pylint: disable=unused-argument """ Only sync StudentModuleHistoryExtended to StudentModuleHistoryExtendedRouter.DATABASE_Name """ - if self._is_csmh(model): - return db == self.DATABASE_NAME - elif db == self.DATABASE_NAME: + if model_name is not None: + model = hints.get('model') + if self._is_csmh(model): + return db == self.DATABASE_NAME + if db == self.DATABASE_NAME: return False return None