Skip to content

Commit

Permalink
Fix KeyError in flask.py
Browse files Browse the repository at this point in the history
When submitting the grade form in the sample flask app
(at /grade), pylti gave me this error:

	KeyError: 'lis_outcome_service_url'

This commit turns the KeyError into a documented exception. I'm
not too familiar with LTI yet so I'm not sure if this behavior
is desired, but seems better to me.
  • Loading branch information
nikolas committed Aug 28, 2015
1 parent 3266843 commit 3a0c865
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pylti/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ def response_url(self):
uses PYLTI_URL_FIX map to support edX dev-stack
:return: remapped lis_outcome_service_url
:exception: LTIException if lis_outcome_service_url isn't present.
"""
if not 'lis_outcome_service_url' in session:
raise LTIException('lis_outcome_service_url isn\'t present.')
url = session['lis_outcome_service_url']
app_config = self.lti_kwargs['app'].config
urls = app_config.get('PYLTI_URL_FIX', dict())
Expand Down

0 comments on commit 3a0c865

Please sign in to comment.