]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/processing.py
Continued:
[fba.git] / fba / helpers / processing.py
index c79815c600dbcee2a234583d63777e05bb830fd9..00f6ae073d036c1d2102051e5853d4cd4e3e1a6f 100644 (file)
@@ -45,6 +45,10 @@ def instance(blocked: str, blocker: str, command: str) -> bool:
         raise ValueError(f"Parameter command[]='{type(command)}' is not of type 'str'")
     elif command == "":
         raise ValueError("Parameter 'command' is empty")
+    elif blacklist.is_blacklisted(blocked):
+        raise ValueError(f"blocked='{blocked}' is blacklisted but function was invoked")
+    elif blacklist.is_blacklisted(blocker):
+        raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
 
     logger.debug("blocked='%s' - BEFORE!", blocked)
     blocked = utils.deobfuscate(blocked, blocker)
@@ -89,6 +93,8 @@ def block(blocker: str, blocked: str, reason: str, block_level: str) -> bool:
         raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not of type 'str'")
     elif block_level == "":
         raise ValueError("Parameter block_level is empty")
+    elif blacklist.is_blacklisted(blocker):
+        raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
     elif blacklist.is_blacklisted(blocked):
         raise ValueError(f"blocked='{blocked}' is blacklisted but function was invoked")
 
@@ -116,6 +122,8 @@ def csv_block(blocker: str, url: str, command: str):
         raise ValueError(f"command[]='{command}' is not of type 'str'")
     elif command == "":
         raise ValueError("Parameter 'command' is empty")
+    elif blacklist.is_blacklisted(blocker):
+        raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
 
     logger.debug("Setting last_blocked for blocker='%s' ...", blocker)
     instances.set_last_blocked(blocker)