Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
23c72e73
Commit
23c72e73
authored
Oct 16, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/gradebook-script-rename: Fixed conflicted command name
parent
4690e310
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
32 deletions
+31
-32
lms/djangoapps/api_manager/management/commands/migrate_courseids_v2.py
+6
-6
lms/djangoapps/gradebook/management/commands/migrate_gradebook_courseids_v2.py
+2
-2
lms/djangoapps/gradebook/management/commands/tests/test_migrate_gradebook_courseids_v2.py
+2
-2
lms/djangoapps/projects/management/commands/migrate_project_courseids_v2.py
+20
-17
lms/djangoapps/projects/management/commands/tests/test_migrate_project_courseids_v2.py
+1
-5
No files found.
lms/djangoapps/api_manager/management/commands/migrate_courseids_v2.py
View file @
23c72e73
...
...
@@ -22,7 +22,7 @@ class Command(BaseCommand):
for
cg
in
course_groups
:
current_course_id
=
cg
.
course_id
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
.
save
()
log
.
warning
(
'Complete!'
)
...
...
@@ -32,12 +32,12 @@ class Command(BaseCommand):
for
ccg
in
course_content_groups
:
current_course_id
=
ccg
.
course_id
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
current_content_id
=
ccg
.
content_id
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
.
save
()
log
.
warning
(
'Complete!'
)
...
...
@@ -47,18 +47,18 @@ class Command(BaseCommand):
for
cmc
in
course_module_completions
:
current_course_id
=
cmc
.
course_id
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
current_content_id
=
cmc
.
content_id
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
if
cmc
.
stage
is
not
None
:
current_stage
=
cmc
.
stage
oldstyle_stage
=
current_stage
.
replace
(
"slashes:"
,
""
)
oldstyle_stage
=
current
_stage
.
replace
(
"+"
,
"/"
)
oldstyle_stage
=
oldstyle
_stage
.
replace
(
"+"
,
"/"
)
cmc
.
stage
=
oldstyle_stage
cmc
.
save
()
log
.
warning
(
'Complete!'
)
lms/djangoapps/gradebook/management/commands/migrate_courseids_v2.py
→
lms/djangoapps/gradebook/management/commands/migrate_
gradebook_
courseids_v2.py
View file @
23c72e73
...
...
@@ -23,7 +23,7 @@ class Command(BaseCommand):
for
gbe
in
gradebook_entries
:
current_course_id
=
unicode
(
gbe
.
course_id
)
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
.
save
()
log
.
warning
(
'Complete!'
)
...
...
@@ -33,7 +33,7 @@ class Command(BaseCommand):
for
he
in
history_entries
:
current_course_id
=
unicode
(
he
.
course_id
)
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
.
save
()
log
.
warning
(
'Complete!'
)
lms/djangoapps/gradebook/management/commands/tests/test_migrate_courseids_v2.py
→
lms/djangoapps/gradebook/management/commands/tests/test_migrate_
gradebook_
courseids_v2.py
View file @
23c72e73
...
...
@@ -8,8 +8,8 @@ import uuid
from
django.contrib.auth.models
import
User
from
gradebook
import
models
as
gradebook_models
from
gradebook.management.commands
import
migrate_courseids_v2
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
gradebook.management.commands
import
migrate_gradebook_courseids_v2
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
...
...
@@ -71,7 +71,7 @@ class MigrateCourseIdsTests(ModuleStoreTestCase):
# Run the data migration
migrate_courseids_v2
.
Command
()
.
handle
()
migrate_
gradebook_
courseids_v2
.
Command
()
.
handle
()
# Confirm that the data has been properly migrated
...
...
lms/djangoapps/projects/management/commands/migrate_project_courseids_v2.py
View file @
23c72e73
...
...
@@ -21,12 +21,12 @@ class Command(BaseCommand):
for
project
in
projects
:
current_course_id
=
project
.
course_id
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
current_content_id
=
project
.
content_id
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
.
save
()
log
.
warning
(
'Complete!'
)
...
...
@@ -34,29 +34,32 @@ class Command(BaseCommand):
log
.
warning
(
'Migrating Workgroup Reviews...'
)
workgroup_reviews
=
WorkgroupReview
.
objects
.
all
()
for
wr
in
workgroup_reviews
:
current_content_id
=
wr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
current_content_id
.
replace
(
"+"
,
"/"
)
wr
.
content_id
=
oldstyle_content_id
wr
.
save
()
if
wr
.
content_id
is
not
None
:
current_content_id
=
wr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
oldstyle_content_id
.
replace
(
"+"
,
"/"
)
wr
.
content_id
=
oldstyle_content_id
wr
.
save
()
log
.
warning
(
'Complete!'
)
log
.
warning
(
'Migrating Workgroup Peer Reviews...'
)
workgroup_peer_reviews
=
WorkgroupPeerReview
.
objects
.
all
()
for
wpr
in
workgroup_reviews
:
current_content_id
=
wpr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
current_content_id
.
replace
(
"+"
,
"/"
)
wpr
.
content_id
=
oldstyle_content_id
wpr
.
save
()
if
wpr
.
content_id
is
not
None
:
current_content_id
=
wpr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
oldstyle_content_id
.
replace
(
"+"
,
"/"
)
wpr
.
content_id
=
oldstyle_content_id
wpr
.
save
()
log
.
warning
(
'Complete!'
)
log
.
warning
(
'Migrating Workgroup Submission Reviews...'
)
workgroup_submission_reviews
=
WorkgroupSubmissionReview
.
objects
.
all
()
for
wsr
in
workgroup_submission_reviews
:
current_content_id
=
wsr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
current_content_id
.
replace
(
"+"
,
"/"
)
wsr
.
content_id
=
oldstyle_content_id
wsr
.
save
()
if
wsr
.
content_id
is
not
None
:
current_content_id
=
wsr
.
content_id
oldstyle_content_id
=
current_content_id
.
replace
(
"slashes:"
,
""
)
oldstyle_content_id
=
oldstyle_content_id
.
replace
(
"+"
,
"/"
)
wsr
.
content_id
=
oldstyle_content_id
wsr
.
save
()
log
.
warning
(
'Complete!'
)
lms/djangoapps/projects/management/commands/tests/test_migrate_project_courseids_v2.py
View file @
23c72e73
...
...
@@ -5,18 +5,14 @@ Run these tests @ Devstack:
from
datetime
import
datetime
import
uuid
from
django.contrib.auth.models
import
Group
,
User
from
django.contrib.auth.models
import
User
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
projects.management.commands
import
migrate_project_courseids_v2
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
from
projects.models
import
Project
,
Workgroup
,
WorkgroupReview
,
WorkgroupPeerReview
,
WorkgroupSubmission
,
WorkgroupSubmissionReview
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
django.db
import
connection
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
MigrateCourseIdsTests
(
TestCase
):
"""
Test suite for data migration script
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment