blob: 88a4008e721a93664804911a56a003da63640eb3 [file] [log] [blame]
from core.models import Site, SiteDeployment
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 = SiteDeployment.objects.filter(site=site)
site_deployment_deleter = SiteDeploymentDeleter()
for site_deployment in site_deployments:
site_deployment_deleter(site_deployment.id)
site.delete()