blob: c97dee13b7336557a7ea1e04cec54f38ab3d034d [file] [log] [blame]
from core.models import Site, SiteDeployments
from observer.deleter import Deleter
from observer.deleters.site_deployment_deleter import SiteDeploymentDeleter
class SiteDeleter(Deleter):
model='Site'
def call(self, pk):
site = Site.objects.get(pk=pk)
site_deployments = SiteDeployments.objects.filter(site=site)
site_deployment_deleter = SiteDeploymentDeleter()
for site_deployment in site_deployments:
site_deployment_deleter(site_deployment.id)
site.delete()