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
034ac1c8
Commit
034ac1c8
authored
Oct 21, 2015
by
Arbab Nazar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10271 from edx/arbab/enrollment-user-list
take the list of users for enrolment change
parents
b50daf5f
85e67bea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
common/djangoapps/student/management/commands/change_enrollment.py
+11
-5
No files found.
common/djangoapps/student/management/commands/change_enrollment.py
View file @
034ac1c8
...
...
@@ -17,7 +17,11 @@ class Command(BaseCommand):
Change enrollment for user joe from audit to honor:
$ ... change_enrollment -u joe -c some/course/id --from audit --to honor
$ ... change_enrollment -u joe,frank,bill -c some/course/id --from audit --to honor
Or
$ ... change_enrollment -u "joe@example.com,frank@example.com,bill@example.com" -c some/course/id --from audit --to honor
Change enrollment for all users in some/course/id from audit to honor
...
...
@@ -40,7 +44,7 @@ class Command(BaseCommand):
metavar
=
'USER'
,
dest
=
'user'
,
default
=
False
,
help
=
"
User to move, if not specified will move all users
in the course"
),
help
=
"
Comma-separated list of users to move
in the course"
),
make_option
(
'-c'
,
'--course'
,
metavar
=
'COURSE_ID'
,
dest
=
'course_id'
,
...
...
@@ -70,10 +74,12 @@ class Command(BaseCommand):
mode
=
options
[
'from_mode'
]
)
if
options
[
'user'
]:
if
'@'
in
options
[
'user'
]:
user
=
User
.
objects
.
get
(
email
=
options
[
'user'
])
user_str
=
options
[
'user'
]
for
username
in
user_str
.
split
(
","
):
if
'@'
in
username
:
user
=
User
.
objects
.
get
(
email
=
username
)
else
:
user
=
User
.
objects
.
get
(
username
=
options
[
'user'
]
)
user
=
User
.
objects
.
get
(
username
=
username
)
filter_args
[
'user'
]
=
user
enrollments
=
CourseEnrollment
.
objects
.
filter
(
**
filter_args
)
if
options
[
'noop'
]:
...
...
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