refactor-migration again
This commit is contained in:
@@ -125,10 +125,10 @@ class SitesRendererAdapter(BaseAdapter):
|
||||
# Get blocks from blueprint (placeholders)
|
||||
blocks = page.blocks_json or []
|
||||
page_metadata = {
|
||||
'entity_type': page.entity_type if hasattr(page, 'entity_type') else None,
|
||||
'content_type': page.content_type if hasattr(page, 'content_type') else None,
|
||||
'cluster_id': None,
|
||||
'cluster_name': None,
|
||||
'cluster_role': None,
|
||||
'content_structure': None,
|
||||
'taxonomy_id': None,
|
||||
'taxonomy_name': None,
|
||||
'internal_links': []
|
||||
@@ -178,7 +178,7 @@ class SitesRendererAdapter(BaseAdapter):
|
||||
if cluster_map and cluster_map.cluster:
|
||||
page_metadata['cluster_id'] = cluster_map.cluster.id
|
||||
page_metadata['cluster_name'] = cluster_map.cluster.name
|
||||
page_metadata['cluster_role'] = cluster_map.role or task.cluster_role if task else None
|
||||
page_metadata['content_structure'] = cluster_map.role or task.content_structure if task else None
|
||||
|
||||
# Get taxonomy mapping
|
||||
taxonomy_map = ContentTaxonomyMap.objects.filter(content=content).first()
|
||||
@@ -190,21 +190,21 @@ class SitesRendererAdapter(BaseAdapter):
|
||||
if content.internal_links:
|
||||
page_metadata['internal_links'] = content.internal_links
|
||||
|
||||
# Use content entity_type if available
|
||||
if content.entity_type:
|
||||
page_metadata['entity_type'] = content.entity_type
|
||||
# Use content_type if available
|
||||
if content.content_type:
|
||||
page_metadata['content_type'] = content.content_type
|
||||
|
||||
# Fallback to task metadata if content not found
|
||||
if task and not page_metadata.get('cluster_id'):
|
||||
if task.cluster:
|
||||
page_metadata['cluster_id'] = task.cluster.id
|
||||
page_metadata['cluster_name'] = task.cluster.name
|
||||
page_metadata['cluster_role'] = task.cluster_role
|
||||
page_metadata['content_structure'] = task.content_structure
|
||||
if task.taxonomy:
|
||||
page_metadata['taxonomy_id'] = task.taxonomy.id
|
||||
page_metadata['taxonomy_name'] = task.taxonomy.name
|
||||
if task.entity_type:
|
||||
page_metadata['entity_type'] = task.entity_type
|
||||
if task.content_type:
|
||||
page_metadata['content_type'] = task.content_type
|
||||
|
||||
pages.append({
|
||||
'id': page.id,
|
||||
|
||||
Reference in New Issue
Block a user