mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 13:31:27 +00:00
fix: Update subdomain when changed
This commit is contained in:
parent
ed342e08a3
commit
0a112f9c0a
|
@ -94,10 +94,15 @@ class Forgejo(Service):
|
|||
def get_url(cls) -> Optional[str]:
|
||||
"""Return service url."""
|
||||
domain = get_domain()
|
||||
return f"https://git.{domain}"
|
||||
subdomain = cls.get_subdomain()
|
||||
return f"https://{subdomain}.{domain}"
|
||||
|
||||
@classmethod
|
||||
def get_subdomain(cls) -> Optional[str]:
|
||||
with ReadUserData() as data:
|
||||
if "gitea" in data["modules"]:
|
||||
return data["modules"]["gitea"]["subdomain"]
|
||||
|
||||
return "git"
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue