blob: c97dee13b7336557a7ea1e04cec54f38ab3d034d [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001from core.models import Site, SiteDeployments
2from observer.deleter import Deleter
3from observer.deleters.site_deployment_deleter import SiteDeploymentDeleter
4
5class SiteDeleter(Deleter):
6 model='Site'
7
8 def call(self, pk):
9 site = Site.objects.get(pk=pk)
10 site_deployments = SiteDeployments.objects.filter(site=site)
11 site_deployment_deleter = SiteDeploymentDeleter()
12 for site_deployment in site_deployments:
13 site_deployment_deleter(site_deployment.id)
14 site.delete()