]> git.mxchange.org Git - fba.git/blobdiff - fba/networks/pleroma.py
Continued:
[fba.git] / fba / networks / pleroma.py
index a7c25184fef675e44cbc364252a5ec7413ec35a5..3b580560cba02ddf154c3b5dae1ad95f30d4fc67 100644 (file)
@@ -21,6 +21,7 @@ import bs4
 from fba import database
 from fba import utils
 
+from fba.helpers import blacklist
 from fba.helpers import config
 from fba.helpers import domain as domain_helper
 from fba.helpers import tidyup
@@ -54,7 +55,9 @@ def fetch_blocks(domain: str) -> list:
     logger.debug("domain='%s' - CALLED!", domain)
     domain_helper.raise_on(domain)
 
-    if not instances.is_registered(domain):
+    if blacklist.is_blacklisted(domain):
+        raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+    elif not instances.is_registered(domain):
         raise Exception(f"domain='{domain}' is not registered but function is invoked.")
 
     blockdict = list()
@@ -292,7 +295,9 @@ def fetch_blocks_from_about(domain: str) -> dict:
     logger.debug("domain='%s' - CALLED!", domain)
     domain_helper.raise_on(domain)
 
-    if not instances.is_registered(domain):
+    if blacklist.is_blacklisted(domain):
+        raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+    elif not instances.is_registered(domain):
         raise Exception(f"domain='{domain}' is not registered but function is invoked.")
 
     logger.debug("Fetching mastodon blocks from domain='%s'", domain)