Commit b38750e1 by Julian Arni

Refactor wrap_xmodule call

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