Commit 56f01ce0 by Alexander Kryklia

Improve code.

parent 32138d35
...@@ -142,7 +142,7 @@ class LTIModule(LTIFields, XModule): ...@@ -142,7 +142,7 @@ class LTIModule(LTIFields, XModule):
try: try:
lti_id, key, secret = lti_passport.split(':') lti_id, key, secret = lti_passport.split(':')
except ValueError: except ValueError:
raise Exception('Could not parse LTI passport: {0}. \ raise Exception('Could not parse LTI passport: {0!r}. \
Should be "id:key:secret" string.'.format(lti_passport)) Should be "id:key:secret" string.'.format(lti_passport))
if lti_id == self.lti_id: if lti_id == self.lti_id:
client_key, client_secret = key, secret client_key, client_secret = key, secret
...@@ -154,7 +154,7 @@ class LTIModule(LTIFields, XModule): ...@@ -154,7 +154,7 @@ class LTIModule(LTIFields, XModule):
try: try:
param_name, param_value = custom_parameter.split('=', 1) param_name, param_value = custom_parameter.split('=', 1)
except ValueError: except ValueError:
raise Exception('Could not parse custom parameter: {0}. \ raise Exception('Could not parse custom parameter: {0!r}. \
Should be "x=y" string.'.format(custom_parameter)) Should be "x=y" string.'.format(custom_parameter))
# LTI specs: 'custom_' should be prepended before each custom parameter # LTI specs: 'custom_' should be prepended before each custom parameter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment