diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-30 14:04:11 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:42:29 +0200 |
| commit | e1b29eafbd0b6285b7bea2e24709c7622d41173d (patch) | |
| tree | 5f923cdf2a3ff2fc271a73a03c6513d06853f6bb /web-server/opendc/api/v2/simulations/simulationId/endpoint.py | |
| parent | 1c58ae3b25120ac670b897665bac7d8f18156220 (diff) | |
Fix all violations
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) |
