Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
1ea4b8a0
Commit
1ea4b8a0
authored
9 years ago
by
Phil McGachey
Browse files
Options
Downloads
Patches
Plain Diff
Logging invalid key errors
parent
577438d0
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/lti_provider/views.py
+10
-2
10 additions, 2 deletions
lms/djangoapps/lti_provider/views.py
with
10 additions
and
2 deletions
lms/djangoapps/lti_provider/views.py
+
10
−
2
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment