Section 1 & 2 - #Migration Run
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user