Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
432a40f0
Commit
432a40f0
authored
9 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Patches
Plain Diff
Update post_cohort_management_fix to Django 1.8
parent
9b5b7837
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py
+15
-2
15 additions, 2 deletions
..._groups/management/commands/post_cohort_membership_fix.py
with
15 additions
and
2 deletions
openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py
+
15
−
2
View file @
432a40f0
...
...
@@ -15,16 +15,29 @@ class Command(BaseCommand):
help
=
'''
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.
|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
):
"""
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
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_add
=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment