Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion list_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
Loading