fix: Update subdomain when changed

This commit is contained in:
Inex Code 2024-07-23 02:25:59 +03:00
parent ed342e08a3
commit 0a112f9c0a

View file

@ -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