try
This commit is contained in:
+4
-4
@@ -1201,8 +1201,8 @@ def prepare_post_data(summary, title, main_topic=None):
|
||||
|
||||
pixabay_url = page_url if image_source == "Pixabay" else None
|
||||
|
||||
authors = ["Aisha Patel", "Ravi Sharma", "Mei Lin", "Carlos Rivera"]
|
||||
author = random.choice(authors)
|
||||
# Select a full author dictionary from AUTHORS (already imported from foodie_config)
|
||||
author = random.choice(AUTHORS)
|
||||
|
||||
categories = ["Food", "Trends", "Eats", "Culture"]
|
||||
category = random.choice(categories)
|
||||
@@ -1211,11 +1211,11 @@ def prepare_post_data(summary, title, main_topic=None):
|
||||
"title": new_title,
|
||||
"content": summary,
|
||||
"status": "publish",
|
||||
"author": author,
|
||||
"author": author["username"], # Use the username in post_data
|
||||
"categories": [category]
|
||||
}
|
||||
|
||||
logging.info(f"Post data prepared: Title: '{new_title}', Category: {category}, Author: {author}")
|
||||
logging.info(f"Post data prepared: Title: '{new_title}', Category: {category}, Author: {author['username']}")
|
||||
return post_data, author, category, image_url, image_source, uploader, pixabay_url
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user