This commit is contained in:
2025-05-03 17:41:26 +10:00
parent 04c6ed530c
commit 6427c2e2a5
+6 -6
View File
@@ -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