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
ca8ab76d
Commit
ca8ab76d
authored
5 years ago
by
Matthew Piatetsky
Browse files
Options
Downloads
Patches
Plain Diff
create data migration to populate FBEEnrollmentExclusion table
parent
db1ef846
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/student/migrations/0025_auto_20191101_1846.py
+33
-0
33 additions, 0 deletions
.../djangoapps/student/migrations/0025_auto_20191101_1846.py
with
33 additions
and
0 deletions
common/djangoapps/student/migrations/0025_auto_20191101_1846.py
0 → 100644
+
33
−
0
View file @
ca8ab76d
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-11-01 18:46
from
__future__
import
unicode_literals
from
django.db
import
migrations
from
experiments.models
import
ExperimentData
from
openedx.features.course_duration_limits.config
import
EXPERIMENT_DATA_HOLDBACK_KEY
,
EXPERIMENT_ID
from
student.models
import
CourseEnrollment
,
FBEEnrollmentExclusion
def
populate_fbeenrollmentexclusion
(
apps
,
schema_editor
):
holdback_entries
=
ExperimentData
.
objects
.
filter
(
experiment_id
=
EXPERIMENT_ID
,
key
=
EXPERIMENT_DATA_HOLDBACK_KEY
,
value
=
'
True
'
)
for
holdback_entry
in
holdback_entries
:
enrollments
=
[
FBEEnrollmentExclusion
(
enrollment
=
enrollment
)
for
enrollment
in
CourseEnrollment
.
objects
.
filter
(
user
=
holdback_entry
.
user
)]
if
enrollments
:
FBEEnrollmentExclusion
.
objects
.
bulk_create
(
enrollments
)
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
student
'
,
'
0024_fbeenrollmentexclusion
'
),
]
operations
=
[
migrations
.
RunPython
(
populate_fbeenrollmentexclusion
,
reverse_code
=
migrations
.
RunPython
.
noop
),
]
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