Commit b6edd7d6 by Matt Drayer

mattdrayer/gradebook-script-rename: Fixed conflicted command name

parent d332578a
...@@ -22,7 +22,7 @@ class Command(BaseCommand): ...@@ -22,7 +22,7 @@ class Command(BaseCommand):
for cg in course_groups: for cg in course_groups:
current_course_id = cg.course_id current_course_id = cg.course_id
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
cg.course_id = oldstyle_course_id cg.course_id = oldstyle_course_id
cg.save() cg.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -32,12 +32,12 @@ class Command(BaseCommand): ...@@ -32,12 +32,12 @@ class Command(BaseCommand):
for ccg in course_content_groups: for ccg in course_content_groups:
current_course_id = ccg.course_id current_course_id = ccg.course_id
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
ccg.course_id = oldstyle_course_id ccg.course_id = oldstyle_course_id
current_content_id = ccg.content_id current_content_id = ccg.content_id
oldstyle_content_id = current_content_id.replace("slashes:", "") oldstyle_content_id = current_content_id.replace("slashes:", "")
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = oldstyle_content_id.replace("+", "/")
ccg.content_id = oldstyle_content_id ccg.content_id = oldstyle_content_id
ccg.save() ccg.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -47,18 +47,18 @@ class Command(BaseCommand): ...@@ -47,18 +47,18 @@ class Command(BaseCommand):
for cmc in course_module_completions: for cmc in course_module_completions:
current_course_id = cmc.course_id current_course_id = cmc.course_id
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
cmc.course_id = oldstyle_course_id cmc.course_id = oldstyle_course_id
current_content_id = cmc.content_id current_content_id = cmc.content_id
oldstyle_content_id = current_content_id.replace("slashes:", "") oldstyle_content_id = current_content_id.replace("slashes:", "")
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = oldstyle_content_id.replace("+", "/")
cmc.content_id = oldstyle_content_id cmc.content_id = oldstyle_content_id
if cmc.stage is not None: if cmc.stage is not None:
current_stage = cmc.stage current_stage = cmc.stage
oldstyle_stage = current_stage.replace("slashes:", "") oldstyle_stage = current_stage.replace("slashes:", "")
oldstyle_stage = current_stage.replace("+", "/") oldstyle_stage = oldstyle_stage.replace("+", "/")
cmc.stage = oldstyle_stage cmc.stage = oldstyle_stage
cmc.save() cmc.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -23,7 +23,7 @@ class Command(BaseCommand): ...@@ -23,7 +23,7 @@ class Command(BaseCommand):
for gbe in gradebook_entries: for gbe in gradebook_entries:
current_course_id = unicode(gbe.course_id) current_course_id = unicode(gbe.course_id)
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
gbe.course_id = CourseKey.from_string(oldstyle_course_id) gbe.course_id = CourseKey.from_string(oldstyle_course_id)
gbe.save() gbe.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -33,7 +33,7 @@ class Command(BaseCommand): ...@@ -33,7 +33,7 @@ class Command(BaseCommand):
for he in history_entries: for he in history_entries:
current_course_id = unicode(he.course_id) current_course_id = unicode(he.course_id)
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
he.course_id = oldstyle_course_id he.course_id = oldstyle_course_id
he.save() he.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -10,7 +10,7 @@ from django.test import TestCase ...@@ -10,7 +10,7 @@ from django.test import TestCase
from django.test.utils import override_settings from django.test.utils import override_settings
from gradebook import models as gradebook_models from gradebook import models as gradebook_models
from gradebook.management.commands import migrate_courseids_v2 from gradebook.management.commands import migrate_gradebook_courseids_v2
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...@@ -75,7 +75,7 @@ class MigrateCourseIdsTests(TestCase): ...@@ -75,7 +75,7 @@ class MigrateCourseIdsTests(TestCase):
# Run the data migration # Run the data migration
migrate_courseids_v2.Command().handle() migrate_gradebook_courseids_v2.Command().handle()
# Confirm that the data has been properly migrated # Confirm that the data has been properly migrated
......
...@@ -21,12 +21,12 @@ class Command(BaseCommand): ...@@ -21,12 +21,12 @@ class Command(BaseCommand):
for project in projects: for project in projects:
current_course_id = project.course_id current_course_id = project.course_id
oldstyle_course_id = current_course_id.replace("slashes:", "") oldstyle_course_id = current_course_id.replace("slashes:", "")
oldstyle_course_id = current_course_id.replace("+", "/") oldstyle_course_id = oldstyle_course_id.replace("+", "/")
project.course_id = oldstyle_course_id project.course_id = oldstyle_course_id
current_content_id = project.content_id current_content_id = project.content_id
oldstyle_content_id = current_content_id.replace("slashes:", "") oldstyle_content_id = current_content_id.replace("slashes:", "")
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = oldstyle_content_id.replace("+", "/")
project.content_id = oldstyle_content_id project.content_id = oldstyle_content_id
project.save() project.save()
log.warning('Complete!') log.warning('Complete!')
...@@ -34,29 +34,32 @@ class Command(BaseCommand): ...@@ -34,29 +34,32 @@ class Command(BaseCommand):
log.warning('Migrating Workgroup Reviews...') log.warning('Migrating Workgroup Reviews...')
workgroup_reviews = WorkgroupReview.objects.all() workgroup_reviews = WorkgroupReview.objects.all()
for wr in workgroup_reviews: for wr in workgroup_reviews:
current_content_id = wr.content_id if wr.content_id is not None:
oldstyle_content_id = current_content_id.replace("slashes:", "") current_content_id = wr.content_id
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = current_content_id.replace("slashes:", "")
wr.content_id = oldstyle_content_id oldstyle_content_id = oldstyle_content_id.replace("+", "/")
wr.save() wr.content_id = oldstyle_content_id
wr.save()
log.warning('Complete!') log.warning('Complete!')
log.warning('Migrating Workgroup Peer Reviews...') log.warning('Migrating Workgroup Peer Reviews...')
workgroup_peer_reviews = WorkgroupPeerReview.objects.all() workgroup_peer_reviews = WorkgroupPeerReview.objects.all()
for wpr in workgroup_reviews: for wpr in workgroup_reviews:
current_content_id = wpr.content_id if wpr.content_id is not None:
oldstyle_content_id = current_content_id.replace("slashes:", "") current_content_id = wpr.content_id
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = current_content_id.replace("slashes:", "")
wpr.content_id = oldstyle_content_id oldstyle_content_id = oldstyle_content_id.replace("+", "/")
wpr.save() wpr.content_id = oldstyle_content_id
wpr.save()
log.warning('Complete!') log.warning('Complete!')
log.warning('Migrating Workgroup Submission Reviews...') log.warning('Migrating Workgroup Submission Reviews...')
workgroup_submission_reviews = WorkgroupSubmissionReview.objects.all() workgroup_submission_reviews = WorkgroupSubmissionReview.objects.all()
for wsr in workgroup_submission_reviews: for wsr in workgroup_submission_reviews:
current_content_id = wsr.content_id if wsr.content_id is not None:
oldstyle_content_id = current_content_id.replace("slashes:", "") current_content_id = wsr.content_id
oldstyle_content_id = current_content_id.replace("+", "/") oldstyle_content_id = current_content_id.replace("slashes:", "")
wsr.content_id = oldstyle_content_id oldstyle_content_id = oldstyle_content_id.replace("+", "/")
wsr.save() wsr.content_id = oldstyle_content_id
wsr.save()
log.warning('Complete!') log.warning('Complete!')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment