Commit b38750e1 by Julian Arni

Refactor wrap_xmodule call

parent 7bfb0804
......@@ -75,13 +75,15 @@ def preview_component(request, location):
component = modulestore().get_item(location)
# wrap_xmodule expects a function, so make a constant function
def get_render():
return component.runtime.render(component, None, "studio_view").content
component.get_html = wrap_xmodule(
component.get_html,
component,
'xmodule_edit.html'
)
return render_to_response('component.html', {
'preview': get_module_previews(request, component)[0],
'editor': wrap_xmodule(get_render, component, 'xmodule_edit.html')(),
'editor': component.runtime.render(component, None, 'studio_view').content,
})
......
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