old automation cleanup adn status feilds of planner udpate
This commit is contained in:
@@ -318,6 +318,12 @@ class GenerateContentFunction(BaseAIFunction):
|
||||
task.status = 'completed'
|
||||
task.save(update_fields=['status', 'updated_at'])
|
||||
|
||||
# NEW: Auto-sync idea status from task status
|
||||
if hasattr(task, 'idea') and task.idea:
|
||||
task.idea.status = 'completed'
|
||||
task.idea.save(update_fields=['status', 'updated_at'])
|
||||
logger.info(f"Updated related idea ID {task.idea.id} to completed")
|
||||
|
||||
return {
|
||||
'count': 1,
|
||||
'content_id': content_record.id,
|
||||
|
||||
@@ -227,6 +227,11 @@ class GenerateIdeasFunction(BaseAIFunction):
|
||||
sector=cluster.sector,
|
||||
)
|
||||
ideas_created += 1
|
||||
|
||||
# Update cluster status to 'mapped' after ideas are generated
|
||||
if cluster and cluster.status == 'new':
|
||||
cluster.status = 'mapped'
|
||||
cluster.save()
|
||||
|
||||
return {
|
||||
'count': ideas_created,
|
||||
|
||||
Reference in New Issue
Block a user