From 10e4623359bb91439784256c2bd18a07cd5f5a6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 8 Aug 2023 22:03:52 +0200 Subject: [PATCH] Continued: - these commands can never have origin=None, so let's prevent them here --- fba/http/federation.py | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.39.5