Formatting

This commit is contained in:
moanos [he/him] 2023-01-11 20:40:05 +01:00
parent ba9c29a3ab
commit 288527a76a

View File

@ -71,9 +71,11 @@ class Instance:
if block_id is None:
response = requests.post(f'https://{server}/api/v1/admin/domain_blocks', data=data, headers=headers)
else:
response = requests.put(f'https://{server}/api/v1/admin/domain_blocks/{block_id}', data=data, headers=headers)
response = requests.put(f'https://{server}/api/v1/admin/domain_blocks/{block_id}', data=data,
headers=headers)
if response.status_code != 200:
raise ConnectionError(f"Could not apply block ({response.status_code}: {response.reason})")
def delete(self, server: str, token: str):
headers = {
f'Authorization': f'Bearer {token}',
@ -82,7 +84,6 @@ class Instance:
if response.status_code != 200:
raise ConnectionError(f"Could not apply block ({response.status_code}: {response.reason})")
@staticmethod
def list_diffs(local_blocklist, remote_blocklist):
diffs = []