diff options
| author | jc0b <j@jc0b.computer> | 2020-06-30 14:12:07 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:43:10 +0200 |
| commit | 66b2d85385d05abb590535da60341876ecdbab71 (patch) | |
| tree | 0656f64a4179d419adac86e488e21def7a7fa2b8 /web-server/opendc/api/v2/simulations/simulationId/endpoint.py | |
| parent | 88d8a9cbeae3466230db6bd13120bd4438abbc66 (diff) | |
| parent | c99ef7504a1374170f88b89faeb7e6dec6a55253 (diff) | |
Merge changes with upstream
Diffstat (limited to 'web-server/opendc/api/v2/simulations/simulationId/endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/endpoint.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py index 282e3291..05b38686 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py @@ -1,5 +1,6 @@ from datetime import datetime +from opendc.models.experiment import Experiment from opendc.models.simulation import Simulation from opendc.models.topology import Topology from opendc.util.database import Database @@ -50,8 +51,10 @@ def DELETE(request): topology = Topology.from_id(topology_id) topology.delete() - # TODO remove all experiments + for experiment_id in simulation.obj['experimentIds']: + experiment = Experiment.from_id(experiment_id) + experiment.delete() simulation.delete() - return Response(200, f'Successfully deleted simulation.', simulation.obj) + return Response(200, 'Successfully deleted simulation.', simulation.obj) |
