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 Tuple of (post_id, post_url) or (None, None) if failed
""" """
try: try:
# Load WordPress credentials from environment # Get WordPress credentials from environment
wp_url = os.getenv('WORDPRESS_URL') wp_url = "https://insiderfoodie.com"
wp_username = os.getenv('WORDPRESS_USERNAME') wp_username = author["username"]
wp_password = os.getenv('WORDPRESS_PASSWORD') wp_password = os.getenv(f"{wp_username.upper()}_PASSWORD")
if not all([wp_url, wp_username, wp_password]): if not wp_password:
logger.error("Missing WordPress credentials in environment variables") logger.error(f"Missing WordPress password for author {wp_username}")
return None, None return None, None
# Initialize WordPress API client # Initialize WordPress API client