Commit c4bb2ac7 by polesye

Remove adding prefix to custom parameters.

parent 79f11de6
...@@ -152,7 +152,7 @@ class LTIModule(LTIFields, XModule): ...@@ -152,7 +152,7 @@ class LTIModule(LTIFields, XModule):
except ValueError: except ValueError:
raise LTIError('Could not parse LTI passport: {0!r}. \ raise LTIError('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.strip():
client_key, client_secret = key, secret client_key, client_secret = key, secret
break break
...@@ -165,8 +165,7 @@ class LTIModule(LTIFields, XModule): ...@@ -165,8 +165,7 @@ class LTIModule(LTIFields, XModule):
raise LTIError('Could not parse custom parameter: {0!r}. \ raise LTIError('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 custom_parameters[unicode(param_name.strip())] = unicode(param_value.strip())
custom_parameters[u'custom_' + unicode(param_name)] = unicode(param_value)
input_fields = self.oauth_params( input_fields = self.oauth_params(
custom_parameters, custom_parameters,
...@@ -177,7 +176,7 @@ class LTIModule(LTIFields, XModule): ...@@ -177,7 +176,7 @@ class LTIModule(LTIFields, XModule):
'input_fields': input_fields, 'input_fields': input_fields,
# these params do not participate in oauth signing # these params do not participate in oauth signing
'launch_url': self.launch_url, 'launch_url': self.launch_url.strip(),
'element_id': self.location.html_id(), 'element_id': self.location.html_id(),
'element_class': self.category, 'element_class': self.category,
'open_in_a_new_page': self.open_in_a_new_page, 'open_in_a_new_page': self.open_in_a_new_page,
...@@ -227,7 +226,7 @@ class LTIModule(LTIFields, XModule): ...@@ -227,7 +226,7 @@ class LTIModule(LTIFields, XModule):
try: try:
__, headers, __ = client.sign( __, headers, __ = client.sign(
unicode(self.launch_url), unicode(self.launch_url.strip()),
http_method=u'POST', http_method=u'POST',
body=body, body=body,
headers=headers) headers=headers)
......
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