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
ff8c58f5
Commit
ff8c58f5
authored
Nov 01, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds a new option to ungenerated_certs to use http in the callback url
parent
9f104eb6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
+7
-0
lms/djangoapps/certificates/queue.py
+8
-2
No files found.
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
View file @
ff8c58f5
...
...
@@ -29,6 +29,11 @@ class Command(BaseCommand):
dest
=
'noop'
,
default
=
False
,
help
=
"Don't add certificate requests to the queue"
),
make_option
(
'--insecure'
,
action
=
'store_true'
,
dest
=
'insecure'
,
default
=
False
,
help
=
"Don't use https for the callback url to the LMS, useful in http test environments"
),
make_option
(
'-c'
,
'--course'
,
metavar
=
'COURSE_ID'
,
dest
=
'course'
,
...
...
@@ -83,6 +88,8 @@ class Command(BaseCommand):
"groups"
)
.
order_by
(
'username'
)
xq
=
XQueueCertInterface
()
if
options
[
'insecure'
]:
xq
.
use_https
=
False
total
=
enrolled_students
.
count
()
count
=
0
start
=
datetime
.
datetime
.
now
(
UTC
)
...
...
lms/djangoapps/certificates/queue.py
View file @
ff8c58f5
...
...
@@ -74,6 +74,7 @@ class XQueueCertInterface(object):
)
self
.
whitelist
=
CertificateWhitelist
.
objects
.
all
()
self
.
restricted
=
UserProfile
.
objects
.
filter
(
allow_certificate
=
False
)
self
.
use_https
=
True
def
regen_cert
(
self
,
student
,
course_id
,
course
=
None
):
"""(Re-)Make certificate for a particular student in a particular course
...
...
@@ -216,9 +217,14 @@ class XQueueCertInterface(object):
def
_send_to_xqueue
(
self
,
contents
,
key
):
if
self
.
use_https
:
proto
=
"https"
else
:
proto
=
"http"
xheader
=
make_xheader
(
'
https://{0}/update_certificate?{1
}'
.
format
(
settings
.
SITE_NAME
,
key
),
key
,
settings
.
CERT_QUEUE
)
'
{0}://{1}/update_certificate?{2
}'
.
format
(
proto
,
settings
.
SITE_NAME
,
key
),
key
,
settings
.
CERT_QUEUE
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
...
...
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