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
327cc04f
Commit
327cc04f
authored
Dec 22, 2014
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix email_opt_in_list export command to parse options correctly.
parent
c11a9f05
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
openedx/core/djangoapps/user_api/management/commands/email_opt_in_list.py
+6
-0
No files found.
openedx/core/djangoapps/user_api/management/commands/email_opt_in_list.py
View file @
327cc04f
...
...
@@ -25,6 +25,7 @@ import time
import
datetime
import
contextlib
import
logging
import
optparse
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.conf
import
settings
...
...
@@ -42,6 +43,9 @@ class Command(BaseCommand):
args
=
"<OUTPUT_FILENAME> <ORG_ALIASES> --courses=COURSE_ID_LIST"
help
=
"Generate a list of email opt-in values for user enrollments."
option_list
=
BaseCommand
.
option_list
+
(
optparse
.
make_option
(
'--courses '
,
action
=
'store'
),
)
# Fields output in the CSV
OUTPUT_FIELD_NAMES
=
[
...
...
@@ -81,6 +85,7 @@ class Command(BaseCommand):
# filter out anything not in that list.
courses
=
self
.
_get_courses_for_org
(
org_list
)
only_courses
=
options
.
get
(
"courses"
)
if
only_courses
is
not
None
:
only_courses
=
[
CourseKey
.
from_string
(
course_key
.
strip
())
...
...
@@ -136,6 +141,7 @@ class Command(BaseCommand):
file_path
=
args
[
0
]
org_list
=
args
[
1
:]
if
os
.
path
.
exists
(
file_path
):
raise
CommandError
(
"File already exists at '{path}'"
.
format
(
path
=
file_path
))
...
...
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