Section 1 & 2 - #Migration Run

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-01 06:29:13 +00:00
parent dd63403e94
commit f81fffc9a6
17 changed files with 149 additions and 44 deletions

View File

@@ -1472,13 +1472,13 @@ class AutomationService:
time.sleep(delay)
def run_stage_7(self):
"""Stage 7: Auto-Approve and Publish Review Content
"""Stage 7: Auto-Approve Review Content
This stage automatically approves content in 'review' status and
marks it as 'published' (or queues for WordPress sync).
marks it as 'approved' (ready for publishing to WordPress).
"""
stage_number = 7
stage_name = "Review → Published"
stage_name = "Review → Approved"
start_time = time.time()
# Query content ready for review
@@ -1538,7 +1538,7 @@ class AutomationService:
'review_total': total_count,
'approved_count': approved_count,
'content_ids': list(Content.objects.filter(
site=self.site, status='published', updated_at__gte=self.run.started_at
site=self.site, status='approved', updated_at__gte=self.run.started_at
).values_list('id', flat=True)),
'partial': True,
'stopped_reason': reason,
@@ -1553,8 +1553,8 @@ class AutomationService:
stage_number, f"Approving content {idx}/{total_count}: {content.title}"
)
# Approve content by changing status to 'published'
content.status = 'published'
# Approve content by changing status to 'approved' (ready for publishing)
content.status = 'approved'
content.save(update_fields=['status', 'updated_at'])
approved_count += 1
@@ -1593,7 +1593,7 @@ class AutomationService:
time_elapsed = self._format_time_elapsed(start_time)
content_ids = list(Content.objects.filter(
site=self.site,
status='published',
status='approved',
updated_at__gte=self.run.started_at
).values_list('id', flat=True))
@@ -1617,7 +1617,7 @@ class AutomationService:
# Release lock
cache.delete(f'automation_lock_{self.site.id}')
logger.info(f"[AutomationService] Stage 7 complete: {approved_count} content pieces approved and published")
logger.info(f"[AutomationService] Stage 7 complete: {approved_count} content pieces approved (ready for publishing)")
def pause_automation(self):
"""Pause current automation run"""