refactor-migration again

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-26 15:12:14 +00:00
parent 2ef98b5113
commit f88aae78b1
23 changed files with 942 additions and 211 deletions

View File

@@ -235,19 +235,19 @@ class PageGenerationService:
'contact': 'page',
'custom': 'page',
}
entity_type = entity_type_map.get(page_blueprint.type, 'page')
content_type = entity_type_map.get(page_blueprint.type, 'page')
# Stage 3: Try to find related cluster and taxonomy from blueprint
cluster_role = 'hub' # Default
# Try to find related cluster and taxonomy from blueprint
content_structure = 'article' # Default
taxonomy = None
# Find cluster link for this blueprint to infer role
# Find cluster link for this blueprint to infer structure
from igny8_core.business.site_building.models import SiteBlueprintCluster
cluster_link = SiteBlueprintCluster.objects.filter(
site_blueprint=page_blueprint.site_blueprint
).first()
if cluster_link:
cluster_role = cluster_link.role
content_structure = cluster_link.role or 'article'
# Find taxonomy if page type suggests it (products/services)
if page_blueprint.type in ['products', 'services']:
@@ -264,13 +264,10 @@ class PageGenerationService:
title=title,
description="\n".join(filter(None, description_parts)),
keywords=keywords,
content_structure=self._map_content_structure(page_blueprint.type),
content_type='article',
content_structure=self._map_content_structure(page_blueprint.type) or content_structure,
content_type=content_type,
status='queued',
# Stage 3: Set entity metadata
entity_type=entity_type,
taxonomy=taxonomy,
cluster_role=cluster_role,
)
logger.info(