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
88cae543
Commit
88cae543
authored
Sep 23, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1085 from edx/ormsbee/ss_err_checking
Add extra error checking and logging to Software Secure callback
parents
89c94b4f
61e7cbb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
lms/djangoapps/verify_student/views.py
+11
-1
No files found.
lms/djangoapps/verify_student/views.py
View file @
88cae543
...
@@ -170,7 +170,17 @@ def results_callback(request):
...
@@ -170,7 +170,17 @@ def results_callback(request):
verified to be who they said they are.
verified to be who they said they are.
"""
"""
body
=
request
.
body
body
=
request
.
body
body_dict
=
json
.
loads
(
body
)
try
:
body_dict
=
json
.
loads
(
body
)
except
ValueError
:
log
.
exception
(
"Invalid JSON received from Software Secure:
\n\n
{}
\n
"
.
format
(
body
))
return
HttpResponseBadRequest
(
"Invalid JSON. Received:
\n\n
{}"
.
format
(
body
))
if
not
isinstance
(
body_dict
,
dict
):
log
.
error
(
"Reply from Software Secure is not a dict:
\n\n
{}
\n
"
.
format
(
body
))
return
HttpResponseBadRequest
(
"JSON should be dict. Received:
\n\n
{}"
.
format
(
body
))
headers
=
{
headers
=
{
"Authorization"
:
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
,
""
),
"Authorization"
:
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
,
""
),
"Date"
:
request
.
META
.
get
(
"HTTP_DATE"
,
""
)
"Date"
:
request
.
META
.
get
(
"HTTP_DATE"
,
""
)
...
...
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