From 6427c2e2a58bb185e0f3193f503f6578562f2290 Mon Sep 17 00:00:00 2001 From: Shane Date: Sat, 3 May 2025 17:41:26 +1000 Subject: [PATCH] try --- foodie_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/foodie_utils.py b/foodie_utils.py index cac7dfe..d36037b 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -516,13 +516,13 @@ def post_to_wp( Tuple of (post_id, post_url) or (None, None) if failed """ try: - # Load WordPress credentials from environment - wp_url = os.getenv('WORDPRESS_URL') - wp_username = os.getenv('WORDPRESS_USERNAME') - wp_password = os.getenv('WORDPRESS_PASSWORD') + # Get WordPress credentials from environment + wp_url = "https://insiderfoodie.com" + wp_username = author["username"] + wp_password = os.getenv(f"{wp_username.upper()}_PASSWORD") - if not all([wp_url, wp_username, wp_password]): - logger.error("Missing WordPress credentials in environment variables") + if not wp_password: + logger.error(f"Missing WordPress password for author {wp_username}") return None, None # Initialize WordPress API client