Makes deleting VMs work with the access controls.
[invirt/packages/invirt-web.git] / controls.py
index 4099d3b..620402b 100644 (file)
@@ -201,6 +201,8 @@ def deleteVM(machine):
             ctx.current.save(nic)
         for disk in machine.disks:
             ctx.current.delete(disk)
+        for access in machine.users:
+            ctx.current.delete(access)
         ctx.current.delete(machine)
         transaction.commit()
     except: