From 7dc9e73423fcab038d5248f9a82b760f3900eaca Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 9 Dec 2024 08:27:30 +0200 Subject: [PATCH] fix: move user_tag variable declaration outside conditional block --- pr_agent/servers/github_polling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/servers/github_polling.py b/pr_agent/servers/github_polling.py index 5eab94dc..05ce0ad1 100644 --- a/pr_agent/servers/github_polling.py +++ b/pr_agent/servers/github_polling.py @@ -84,6 +84,7 @@ async def is_valid_notification(notification, headers, handled_ids, session, use return False, handled_ids async with session.get(latest_comment, headers=headers) as comment_response: check_prev_comments = False + user_tag = "@" + user_id if comment_response.status == 200: comment = await comment_response.json() if 'id' in comment: @@ -101,7 +102,6 @@ async def is_valid_notification(notification, headers, handled_ids, session, use get_logger().debug(f"no comment_body") check_prev_comments = True else: - user_tag = "@" + user_id if user_tag not in comment_body: get_logger().debug(f"user_tag not in comment_body") check_prev_comments = True