Commit 569c5def by Calen Pennington

Make uses of quote_slashes always operate on encoded strings

parent f6731342
......@@ -16,7 +16,7 @@ def handler_url(block, handler_name, suffix='', query='', thirdparty=False):
raise NotImplementedError("edX Studio doesn't support third-party xblock handler urls")
url = reverse('component_handler', kwargs={
'usage_id': quote_slashes(str(block.scope_ids.usage_id)),
'usage_id': quote_slashes(unicode(block.scope_ids.usage_id).encode('utf-8')),
'handler': handler_name,
'suffix': suffix,
}).rstrip('/')
......
......@@ -71,12 +71,12 @@ def wrap_xblock(runtime_class, block, view, frag, context, display_name_only=Fal
data['runtime-class'] = runtime_class
data['runtime-version'] = frag.js_init_version
data['block-type'] = block.scope_ids.block_type
data['usage-id'] = quote_slashes(str(block.scope_ids.usage_id))
data['usage-id'] = quote_slashes(unicode(block.scope_ids.usage_id).encode('utf-8'))
template_context = {
'content': block.display_name if display_name_only else frag.content,
'classes': css_classes,
'data_attributes': ' '.join('data-{}="{}"'.format(key, value) for key, value in data.items()),
'data_attributes': ' '.join(u'data-{}="{}"'.format(key, value) for key, value in data.items()),
}
return wrap_fragment(frag, render_to_string('xblock_wrapper.html', template_context))
......
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