From: Roland Häder Date: Tue, 8 Aug 2023 20:03:52 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=10e4623359bb91439784256c2bd18a07cd5f5a6d;p=fba.git Continued: - these commands can never have origin=None, so let's prevent them here --- diff --git a/fba/http/federation.py b/fba/http/federation.py index 1c8f329..2c616a6 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -56,6 +56,8 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: raise ValueError(f"Parameter command[]='{type(command)}' is not of type 'str'") elif command == "": raise ValueError("Parameter 'command' is empty") + elif command in ["fetch_blocks", "fetch_cs", "fetch_bkali", "fetch_relays", "fetch_fedipact", "fetch_joinmobilizon", "fetch_joinmisskey", "fetch_joinfediverse"] and origin is None: + raise ValueError("Parameter command='%s' but origin is None, please fix invoking this function.", command) elif software is None: try: logger.debug("Software for domain='%s' is not set, determining ...", domain)