mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +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]:
|
def get_url(cls) -> Optional[str]:
|
||||||
"""Return service url."""
|
"""Return service url."""
|
||||||
domain = get_domain()
|
domain = get_domain()
|
||||||
return f"https://git.{domain}"
|
subdomain = cls.get_subdomain()
|
||||||
|
return f"https://{subdomain}.{domain}"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_subdomain(cls) -> Optional[str]:
|
def get_subdomain(cls) -> Optional[str]:
|
||||||
|
with ReadUserData() as data:
|
||||||
|
if "gitea" in data["modules"]:
|
||||||
|
return data["modules"]["gitea"]["subdomain"]
|
||||||
|
|
||||||
return "git"
|
return "git"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue