Fix command line migrator

This commit is contained in:
Don Mitchell
2014-10-20 14:34:33 -04:00
parent b9c37120b3
commit 4fc8ed8e7a
2 changed files with 4 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ class Command(BaseCommand):
except IndexError:
pass
return course_key, user, org, course, run
return course_key, user.id, org, course, run
def handle(self, *args, **options):
course_key, user, org, course, run = self.parse_args(*args)

View File

@@ -11,6 +11,7 @@ import logging
from xblock.fields import Reference, ReferenceList, ReferenceValueDict
from xmodule.modulestore import ModuleStoreEnum
from opaque_keys.edx.locator import CourseLocator
from xmodule.modulestore.exceptions import ItemNotFoundError
log = logging.getLogger(__name__)
@@ -46,6 +47,8 @@ class SplitMigrator(object):
# create the course: set fields to explicitly_set for each scope, id_root = new_course_locator, master_branch = 'production'
original_course = self.source_modulestore.get_course(source_course_key, **kwargs)
if original_course is None:
raise ItemNotFoundError(unicode(source_course_key))
if new_org is None:
new_org = source_course_key.org