summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/simulations
diff options
context:
space:
mode:
Diffstat (limited to 'web-server/opendc/api/v2/simulations')
-rw-r--r--web-server/opendc/api/v2/simulations/endpoint.py2
-rw-r--r--web-server/opendc/api/v2/simulations/simulationId/endpoint.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/web-server/opendc/api/v2/simulations/endpoint.py b/web-server/opendc/api/v2/simulations/endpoint.py
index c978fad7..bcdea650 100644
--- a/web-server/opendc/api/v2/simulations/endpoint.py
+++ b/web-server/opendc/api/v2/simulations/endpoint.py
@@ -15,7 +15,7 @@ def POST(request):
topology = Topology({'name': 'Default topology', 'rooms': []})
topology.insert()
- simulation = Simulation({'simulation': request.params_body['simulation']})
+ simulation = Simulation(request.params_body['simulation'])
simulation.set_property('datetimeCreated', Database.datetime_to_string(datetime.now()))
simulation.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now()))
simulation.set_property('topologyIds', [topology.get_id()])
diff --git a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py
index 05b38686..93617ea8 100644
--- a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py
+++ b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py
@@ -55,6 +55,6 @@ def DELETE(request):
experiment = Experiment.from_id(experiment_id)
experiment.delete()
- simulation.delete()
+ old_object = simulation.delete()
- return Response(200, 'Successfully deleted simulation.', simulation.obj)
+ return Response(200, 'Successfully deleted simulation.', old_object)