summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
diff options
context:
space:
mode:
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()