From 86665de33ff85adc581b1bfe3bd055945706b967 Mon Sep 17 00:00:00 2001 From: Umar Hassan Date: Fri, 20 Sep 2024 10:48:19 +0500 Subject: [PATCH] added remove for sites content with type website for unpublished or not downloadable sites --- content_sync/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content_sync/tasks.py b/content_sync/tasks.py index a8d9109d3..2b1430ecd 100644 --- a/content_sync/tasks.py +++ b/content_sync/tasks.py @@ -465,6 +465,10 @@ def update_websites_in_root_website(): sites = get_publishable_sites(is_offline=True) # Exclude the root website sites = sites.exclude(name=settings.ROOT_WEBSITE_NAME) + + # Remove the content for unpublished or not downloadable sites + WebsiteContent.objects.exclude(website__in=sites).delete() + fields = [ "website", "type",