mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-09 20:53:10 +00:00
Revert "feat: move get_subdomain to parent class really"
This reverts commit 4eaefc8321
.
This commit is contained in:
parent
8bb9166287
commit
c42e2ef3ac
|
@ -44,6 +44,14 @@ class Roundcube(Service):
|
||||||
subdomain = get_subdomain()
|
subdomain = get_subdomain()
|
||||||
return f"https://{subdomain}.{domain}"
|
return f"https://{subdomain}.{domain}"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_subdomain() -> Optional[str]:
|
||||||
|
with ReadUserData() as data:
|
||||||
|
if "roundcube" in data["modules"]:
|
||||||
|
return data["modules"]["roundcube"]["subdomain"]
|
||||||
|
|
||||||
|
return "webmail"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_movable() -> bool:
|
def is_movable() -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
"""Abstract class for a service running on a server"""
|
"""Abstract class for a service running on a server"""
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
@ -74,14 +73,13 @@ class Service(ABC):
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
@abstractmethod
|
||||||
def get_subdomain() -> Optional[str]:
|
def get_subdomain() -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
The assigned primary subdomain for this service.
|
The assigned primary subdomain for this service.
|
||||||
"""
|
"""
|
||||||
with ReadUserData() as data:
|
pass
|
||||||
if self.get_display_name() in data["modules"]:
|
|
||||||
if "subdomain" in data["modules"][self.get_display_name()]:
|
|
||||||
return data["modules"][self.get_display_name()]["subdomain"]
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_user(cls) -> Optional[str]:
|
def get_user(cls) -> Optional[str]:
|
||||||
|
|
Loading…
Reference in a new issue