diff --git a/list_builder.py b/list_builder.py index 6d3787f1..034da6b3 100755 --- a/list_builder.py +++ b/list_builder.py @@ -31,7 +31,8 @@ now = time.time() TOOLS_DIR = Path(__file__).resolve().parent -FORUM_TOKEN = (TOOLS_DIR / ".forum_token").open("r", encoding="utf-8").read().strip() +TOKEN_PATH = TOOLS_DIR / ".forum_token" +FORUM_TOKEN = TOKEN_PATH.open("r", encoding="utf-8").read().strip() if TOKEN_PATH.is_file() else None FORUM_URL = "https://forum.yunohost.org" @cache @@ -235,6 +236,9 @@ def build_app_dict(app, infos, cache_path: Path): } def put_forum_app_tags(forum_app_tags): + if FORUM_TOKEN is None: + logging.warning("FORUM_TOKEN not set, skipping tags update.") + return {} # 8 is the ID of the Applications tags list # We send the whole list, Discourse can manage pre-existing tags url = f"{FORUM_URL}/tag_groups/8.json"