From 3592c97627851c8f4155658cebdb6025fb80d078 Mon Sep 17 00:00:00 2001 From: Shawn Grigson Date: Tue, 12 Sep 2023 08:13:17 -0500 Subject: [PATCH] revert --- src/fediblockhole/__init__.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/fediblockhole/__init__.py b/src/fediblockhole/__init__.py index d78e7c2..97e6f51 100755 --- a/src/fediblockhole/__init__.py +++ b/src/fediblockhole/__init__.py @@ -402,9 +402,6 @@ def fetch_instance_blocklist(host: str, token: str=None, admin: bool=False, link = True while link: response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT) - if response.status_code == 401: - log.error(f"Cannot fetch remote blocklist. Access token has been revoked for {host}, skipping....") - break if response.status_code != 200: log.error(f"Cannot fetch remote blocklist: {response.content}") raise ValueError("Unable to fetch domain block list: %s", response) @@ -485,8 +482,7 @@ def fetch_instance_follows(token: str, host: str, domain: str, scheme: str='http if response.status_code == 403: log.error(f"Cannot fetch follow information for {domain} from {host}: {response.content}") - if response.status_code != 401: - raise ValueError(f"Something went wrong: {response.status_code}: {response.content}") + raise ValueError(f"Something went wrong: {response.status_code}: {response.content}") # Get the total returned follows = int(response.json()[0]['total']) @@ -555,9 +551,6 @@ def add_block(token: str, host: str, blockdata: DomainBlock, scheme: str='https' err = json.loads(response.content) log.warning(err['error']) - elif response.status_code == 401: - log.warning(f"Access token has been revoked for {host}, no blocks being updated.") - elif response.status_code != 200: raise ValueError(f"Something went wrong: {response.status_code}: {response.content}")