From d2022222c3100a97c95f083fa297bb8c087736c7 Mon Sep 17 00:00:00 2001 From: Shane Date: Sun, 4 May 2025 12:14:00 +1000 Subject: [PATCH] try --- foodie_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foodie_utils.py b/foodie_utils.py index a2822ce..4ba722a 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -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: