From aa27d344af45bfd7f36514f98ed862af353d1623 Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 12 May 2025 17:08:07 +1000 Subject: [PATCH] try --- foodie_weekly_thread.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/foodie_weekly_thread.py b/foodie_weekly_thread.py index 1c36f3e..004456b 100644 --- a/foodie_weekly_thread.py +++ b/foodie_weekly_thread.py @@ -99,7 +99,7 @@ except Exception as e: def generate_intro_tweet(author): """Generate an intro tweet for the weekly thread.""" - credentials = next((cred for cred in X_API_CREDENTIALS if cred["username"] == author["username"]), None) + credentials = X_API_CREDENTIALS.get(author["username"]) if not credentials: logging.error(f"No X credentials found for {author['username']}") return None @@ -145,7 +145,7 @@ def generate_intro_tweet(author): def generate_final_cta(author): """Generate a final CTA tweet for the weekly thread using GPT.""" - credentials = next((cred for cred in X_API_CREDENTIALS if cred["username"] == author["username"]), None) + credentials = X_API_CREDENTIALS.get(author["username"]) if not credentials: logging.error(f"No X credentials found for {author['username']}") return None