Optimize default URL fallback mechanism
Some checks failed
/ chores (push) Failing after 14s

Refactored the assignment of FORGEJO_URL to use a more idiomatic fallback approach in case the environment variable is not set. This change ensures that None values are handled correctly and the default URL is used when the environment variable FORGEJO_URL is undefined, enhancing reliability.
This commit is contained in:
Kumi 2024-02-18 13:22:23 +01:00
parent 3d13ae755a
commit 623115295a
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -7,7 +7,7 @@ import logging
from datetime import datetime, timedelta
FORGEJO_URL = os.environ.get("FORGEJO_URL", "https://git.private.coffee")
FORGEJO_URL = os.environ.get("FORGEJO_URL") or "https://git.private.coffee"
try:
TOKEN = os.environ["FORGEJO_TOKEN"]