Commit 432a40f0 by Ned Batchelder

Update post_cohort_management_fix to Django 1.8

parent 9b5b7837
...@@ -15,16 +15,29 @@ class Command(BaseCommand): ...@@ -15,16 +15,29 @@ class Command(BaseCommand):
help = ''' help = '''
Repairs any potential inconsistencies made in the window between running migrations 0005 and 0006, and deploying Repairs any potential inconsistencies made in the window between running migrations 0005 and 0006, and deploying
the code changes to enforce use of CohortMembership that go with said migrations. the code changes to enforce use of CohortMembership that go with said migrations.
|commit|: optional argument. If not provided, will dry-run and list number of operations that would be made.
commit: optional argument. If not provided, will dry-run and list number of operations that would be made.
''' '''
def add_arguments(self, parser):
"""
Add arguments to the command parser.
"""
parser.add_argument(
'--commit',
action='store_true',
dest='commit',
default=False,
help='Really commit the changes, otherwise, just dry run',
)
def handle(self, *args, **options): def handle(self, *args, **options):
""" """
Execute the command. Since this is designed to fix any issues cause by running pre-CohortMembership code Execute the command. Since this is designed to fix any issues cause by running pre-CohortMembership code
with the database already migrated to post-CohortMembership state, we will use the pre-CohortMembership 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. table CourseUserGroup as the canonical source of truth. This way, changes made in the window are persisted.
""" """
commit = 'commit' in options commit = options['commit']
memberships_to_delete = 0 memberships_to_delete = 0
memberships_to_add = 0 memberships_to_add = 0
......
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