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
666828f7
Commit
666828f7
authored
Jan 28, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Command for certificate whitelist
parent
7e033d02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lms/djangoapps/certificates/management/commands/cert_whitelist.py
+6
-5
No files found.
lms/djangoapps/certificates/management/commands/cert_whitelist.py
View file @
666828f7
from
django.core.management.base
import
BaseCommand
,
CommandError
import
os
from
optparse
import
make_option
from
student.models
import
UserProfile
from
certificates.models
import
CertificateWhitelist
from
django.contrib.auth.models
import
User
class
Command
(
BaseCommand
):
help
=
"""
...
...
@@ -59,7 +58,8 @@ class Command(BaseCommand):
else
:
user
=
User
.
objects
.
get
(
username
=
user_str
)
cert_whitelist
,
created
=
CertificateWhitelist
.
objects
.
get_or_create
(
cert_whitelist
,
created
=
\
CertificateWhitelist
.
objects
.
get_or_create
(
user
=
user
,
course_id
=
course_id
)
if
options
[
'add'
]:
cert_whitelist
.
whitelist
=
True
...
...
@@ -69,5 +69,6 @@ class Command(BaseCommand):
whitelist
=
CertificateWhitelist
.
objects
.
all
()
print
"User whitelist for course {0}:
\n
{1}"
.
format
(
course_id
,
'
\n
'
.
join
([
"{0} {1} {2}"
.
format
(
u
.
user
.
username
,
u
.
user
.
email
,
u
.
whitelist
)
for
u
in
whitelist
]))
'
\n
'
.
join
([
"{0} {1} {2}"
.
format
(
u
.
user
.
username
,
u
.
user
.
email
,
u
.
whitelist
)
for
u
in
whitelist
]))
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