From 3cab4ec5bdfe5672ae848105d455f93c51a5f913 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 10 Dec 2023 02:06:59 +0100 Subject: [PATCH] Continued: - simplified code, no need for this extra indenting --- fba/models/blocks.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fba/models/blocks.py b/fba/models/blocks.py index 904286d..601db5d 100644 --- a/fba/models/blocks.py +++ b/fba/models/blocks.py @@ -146,11 +146,9 @@ def add(blocker: str, blocked: str, reason: str, block_level: str): elif reason is not None and reason == "": raise Exception(f"blocker='{blocker}',blocked='{blocked}',block_level='{block_level}' has empty (not 'None') block reason set") - if reason is not None: - # Maybe needs cleaning - logger.debug("reason='%s' - BEFORE!") - reason = tidyup.reason(reason) - logger.debug("reason='%s' - AFTER!") + logger.debug("reason='%s' - BEFORE!") + reason = tidyup.reason(reason) if reason is not None and reason != "" else None + logger.debug("reason='%s' - AFTER!") logger.info("New block: blocker='%s',blocked='%s',reason='%s',block_level='%s'", blocker, blocked, reason, block_level) -- 2.39.5