summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
diff options
context:
space:
mode:
authorjc0b <j@jc0b.computer>2020-07-07 16:55:22 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:51 +0200
commit223e916997eb641a1662110b6de630a4cdfdf479 (patch)
tree90ca4364461f676db45f25e03d8f22fc32f9fdd8 /web-server/opendc/api/v2/topologies/topologyId/endpoint.py
parent9ff1e3c6bae253372a468dbdc9b8369ab8dd2c6f (diff)
parentb810c4413079bf5aeb5374f1cd20e151a83530d0 (diff)
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
Diffstat (limited to 'web-server/opendc/api/v2/topologies/topologyId/endpoint.py')
-rw-r--r--web-server/opendc/api/v2/topologies/topologyId/endpoint.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
index 1dcccb3e..512b050a 100644
--- a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
+++ b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
@@ -1,7 +1,7 @@
from datetime import datetime
from opendc.util.database import Database
-from opendc.models.simulation import Simulation
+from opendc.models.project import Project
from opendc.models.topology import Topology
from opendc.util.rest import Response
@@ -45,11 +45,11 @@ def DELETE(request):
topology.check_exists()
topology.check_user_access(request.google_id, True)
- simulation = Simulation.from_id(topology.obj['simulationId'])
- simulation.check_exists()
- if request.params_path['topologyId'] in simulation.obj['topologyIds']:
- simulation.obj['topologyIds'].remove(request.params_path['topologyId'])
- simulation.update()
+ project = Project.from_id(topology.obj['projectId'])
+ project.check_exists()
+ if request.params_path['topologyId'] in project.obj['topologyIds']:
+ project.obj['topologyIds'].remove(request.params_path['topologyId'])
+ project.update()
old_object = topology.delete()