blocks.add(blocker, blocked, reason, block_level)
added = True
else:
+ if reason not in [None, ""] and blocks.get_reason(blocker, blocked, block_level) is None:
+ logger.debug("Updating reason='%s' for blocker='%s',blocked='%s',block_level='%s' ...", reason, blocker, blocked, block_level)
+ blocks.update_reason(reason, blocker, blocked, block_level)
+
logger.debug("Updating last_seen for blocker='%s',blocked='%s',block_level='%s' ...", blocker, blocked, block_level)
blocks.update_last_seen(blocker, blocked, block_level)
if not isinstance(url, str):
raise ValueError(f"url[]='{url}' is not of type 'str'")
- elif url == "":
+ elif url in [None, ""]:
raise ValueError("Parameter 'url' is empty")
elif not validators.url(url):
raise ValueError(f"Parameter url='{url}' is not a valid URL")