fix: move user_tag variable declaration outside conditional block

This commit is contained in:
mrT23
2024-12-09 08:27:30 +02:00
parent e68e100117
commit 7dc9e73423

View File

@ -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