Creditsupdates in fotoer wdigets adn hoemapge and singe site settigns page #Run MIgration 0033 #MAJOR
This commit is contained in:
@@ -340,6 +340,7 @@ class AutoClusterFunction(BaseAIFunction):
|
||||
return {
|
||||
'count': clusters_created,
|
||||
'clusters_created': clusters_created,
|
||||
'keywords_updated': keywords_updated
|
||||
'keywords_updated': keywords_updated,
|
||||
'site_id': site.id if site else None
|
||||
}
|
||||
|
||||
|
||||
@@ -329,6 +329,7 @@ class GenerateContentFunction(BaseAIFunction):
|
||||
'content_id': content_record.id,
|
||||
'task_id': task.id,
|
||||
'word_count': word_count,
|
||||
'site_id': task.site_id if task.site_id else None,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -233,9 +233,19 @@ class GenerateIdeasFunction(BaseAIFunction):
|
||||
cluster.status = 'mapped'
|
||||
cluster.save()
|
||||
|
||||
# Get site_id from the first cluster if available
|
||||
site_id = None
|
||||
if clusters:
|
||||
first_cluster = clusters[0]
|
||||
if first_cluster.site_id:
|
||||
site_id = first_cluster.site_id
|
||||
elif first_cluster.sector and first_cluster.sector.site_id:
|
||||
site_id = first_cluster.sector.site_id
|
||||
|
||||
return {
|
||||
'count': ideas_created,
|
||||
'ideas_created': ideas_created
|
||||
'ideas_created': ideas_created,
|
||||
'site_id': site_id
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@ class GenerateImagePromptsFunction(BaseAIFunction):
|
||||
return {
|
||||
'count': prompts_created,
|
||||
'prompts_created': prompts_created,
|
||||
'site_id': content.site_id if content.site_id else None
|
||||
}
|
||||
|
||||
# Helper methods
|
||||
|
||||
@@ -196,7 +196,8 @@ class GenerateImagesFunction(BaseAIFunction):
|
||||
return {
|
||||
'count': 1,
|
||||
'images_created': 1,
|
||||
'image_id': image.id
|
||||
'image_id': image.id,
|
||||
'site_id': task.site_id if task.site_id else None
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ class OptimizeContentFunction(BaseAIFunction):
|
||||
'html_content': optimized_html,
|
||||
'meta_title': optimized_meta_title,
|
||||
'meta_description': optimized_meta_description,
|
||||
'site_id': content.site_id if content.site_id else None
|
||||
}
|
||||
|
||||
# Helper methods
|
||||
|
||||
Reference in New Issue
Block a user