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
1ea4b8a0
Commit
1ea4b8a0
authored
May 27, 2015
by
Phil McGachey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logging invalid key errors
parent
577438d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lms/djangoapps/lti_provider/views.py
+10
-2
No files found.
lms/djangoapps/lti_provider/views.py
View file @
1ea4b8a0
...
...
@@ -8,6 +8,7 @@ from django.contrib.auth.views import redirect_to_login
from
django.core.urlresolvers
import
reverse
from
django.http
import
HttpResponseBadRequest
,
HttpResponseForbidden
,
Http404
from
django.views.decorators.csrf
import
csrf_exempt
import
logging
from
courseware.access
import
has_access
from
courseware.courses
import
get_course_with_access
...
...
@@ -18,6 +19,9 @@ from lms_xblock.runtime import unquote_slashes
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
opaque_keys
import
InvalidKeyError
log
=
logging
.
getLogger
(
"edx.lti_provider"
)
# LTI launch parameters that must be present for a successful launch
REQUIRED_PARAMETERS
=
[
'roles'
,
'context_id'
,
'oauth_version'
,
'oauth_consumer_key'
,
...
...
@@ -69,9 +73,13 @@ def lti_launch(request, course_id, usage_id):
try
:
course_key
,
usage_key
=
parse_course_and_usage_keys
(
course_id
,
usage_id
)
except
InvalidKeyError
:
raise
Http404
(
'Invalid course key {} or usage key {}'
.
format
(
course_id
,
usage_id
)
log
.
error
(
'Invalid course key
%
s or usage key
%
s from request
%
s'
,
course_id
,
usage_id
,
request
)
raise
Http404
()
params
[
'course_key'
]
=
course_key
params
[
'usage_key'
]
=
usage_key
request
.
session
[
LTI_SESSION_KEY
]
=
params
...
...
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