From ba9c29a3abaedff8427bab05b642a3176b64f320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 11 Jan 2023 20:39:46 +0100 Subject: [PATCH] Fix bug with no-delete option --- models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/models.py b/models.py index c481517..af969e5 100644 --- a/models.py +++ b/models.py @@ -109,10 +109,11 @@ class Instance: @staticmethod def apply_blocks_from_diff(diffs, server, token, no_delete: bool): for diff in diffs: - if diff["local"] is None and not no_delete: - """Delete the block on the remote server""" - diff['remote'].delete(server, token) - logging.info(f"Deleted {diff['remote'].domain} from blocklist") + if diff["local"] is None: + if not no_delete: + """Delete the block on the remote server""" + diff['remote'].delete(server, token) + logging.info(f"Deleted {diff['remote'].domain} from blocklist") elif diff["remote"] is None: """Add the block on the remote server""" diff["local"].apply(server, token)