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
3731144d
Commit
3731144d
authored
Feb 05, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only move students if they aren't in the new course.
parent
235d10dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
common/djangoapps/student/management/commands/transfer_students.py
+9
-0
No files found.
common/djangoapps/student/management/commands/transfer_students.py
View file @
3731144d
...
...
@@ -37,6 +37,15 @@ class Command(BaseCommand):
courseenrollment__course_id
=
source
)
for
user
in
source_students
:
if
CourseEnrollment
.
is_enrolled
(
student
,
dest
):
# Un Enroll from source course but don't mess
# with the enrollment in the destination course.
CourseEnrollment
.
unenroll
(
user
,
source
)
print
(
"Unenrolled {} from {}"
.
format
(
user
.
username
,
source
))
msg
=
"Skipping {}, already enrolled in destination course {}"
print
(
msg
.
format
(
user
.
username
,
dest
))
continue
print
(
"Moving {}."
.
format
(
user
.
username
))
# Find the old enrollment.
enrollment
=
CourseEnrollment
.
objects
.
get
(
user
=
user
,
...
...
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