Commit 1480420c authored by Jérome Perrin's avatar Jérome Perrin

make return json consistent between KE and runSimulation

{'success': True, 'data': data}
parent c75a13a9
...@@ -147,7 +147,7 @@ def runSimulation(): ...@@ -147,7 +147,7 @@ def runSimulation():
def _runSimulation(parameter_dict): def _runSimulation(parameter_dict):
try: try:
return dict(success=getGUIInstance().run(parameter_dict)) return dict(success=True, data=getGUIInstance().run(parameter_dict))
except Exception, e: except Exception, e:
tb = traceback.format_exc() tb = traceback.format_exc()
app.logger.error(tb) app.logger.error(tb)
......
...@@ -186,8 +186,8 @@ ...@@ -186,8 +186,8 @@
$('#result_list').empty(); $('#result_list').empty();
$('#error').empty(); $('#error').empty();
if (data['success']) { if (data['success']) {
$("#json_result").val(JSON.stringify(data['success'], $("#json_result").val(JSON.stringify(data.data, undefined, " "));
undefined, " "));
$.each(data['success'], function (idx, obj) { $.each(data['success'], function (idx, obj) {
$('#result_list').append('<li class="result"></li>'); $('#result_list').append('<li class="result"></li>');
$('#result_list').children().last().text(idx + ' : ' + obj['score'] + ' ' + obj['key']).click( $('#result_list').children().last().text(idx + ' : ' + obj['score'] + ' ' + obj['key']).click(
......
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