From adc0d4ec4e20114cc05d1cc7712e8f08021e13d1 Mon Sep 17 00:00:00 2001 From: Yoann MALLEMANCHE Date: Sun, 6 Aug 2023 17:54:34 +0200 Subject: [PATCH] fix bug when failing to get user's posts --- find_posts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/find_posts.py b/find_posts.py index 8b9041b..53710a7 100644 --- a/find_posts.py +++ b/find_posts.py @@ -137,7 +137,7 @@ def get_user_posts_mastodon(userName, webserver): try: user_id = get_user_id(webserver, userName) except Exception as ex: - log(f"Error getting user ID for user {user['acct']}: {ex}") + log(f"Error getting user ID for user {userName}: {ex}") return None try: @@ -148,14 +148,14 @@ def get_user_posts_mastodon(userName, webserver): return response.json() elif response.status_code == 404: raise Exception( - f"User {user['acct']} was not found on server {webserver}" + f"User {userName} was not found on server {webserver}" ) else: raise Exception( f"Error getting URL {url}. Status code: {response.status_code}" ) except Exception as ex: - log(f"Error getting posts for user {user['acct']}: {ex}") + log(f"Error getting posts for user {userName}: {ex}") return None def get_user_posts_lemmy(userName, userUrl, webserver):