Fix bug with no-delete option

This commit is contained in:
moanos [he/him] 2023-01-11 20:39:46 +01:00
parent 4ddac75d9a
commit ba9c29a3ab

View File

@ -109,10 +109,11 @@ class Instance:
@staticmethod @staticmethod
def apply_blocks_from_diff(diffs, server, token, no_delete: bool): def apply_blocks_from_diff(diffs, server, token, no_delete: bool):
for diff in diffs: for diff in diffs:
if diff["local"] is None and not no_delete: if diff["local"] is None:
"""Delete the block on the remote server""" if not no_delete:
diff['remote'].delete(server, token) """Delete the block on the remote server"""
logging.info(f"Deleted {diff['remote'].domain} from blocklist") diff['remote'].delete(server, token)
logging.info(f"Deleted {diff['remote'].domain} from blocklist")
elif diff["remote"] is None: elif diff["remote"] is None:
"""Add the block on the remote server""" """Add the block on the remote server"""
diff["local"].apply(server, token) diff["local"].apply(server, token)