diff --git a/api/ovdashboard_api/settings.py b/api/ovdashboard_api/settings.py index 426c7b7..497baf9 100644 --- a/api/ovdashboard_api/settings.py +++ b/api/ovdashboard_api/settings.py @@ -31,16 +31,6 @@ class DavSettings(BaseModel): return f"{self.protocol}://{self.host}{self.path}" - @classmethod - @property - def default(cls) -> "DavSettings": - return cls( - protocol="https", - host="example.com", - username="ovdashboard", - password="secret", - ) - class Settings(BaseSettings): """ @@ -84,15 +74,20 @@ class Settings(BaseSettings): if key not in values: values[key] = {} - default_dav = DavSettings.default.dict() + default_dav = DavSettings( + protocol="https", + host="example.com", + username="ovdashboard", + password="secret", + ).dict() for key in default_dav: # if "webdav" value is not specified, use default - if key not in values["webdav"]: + if key not in values["webdav"] or values["webdav"][key] is None: values["webdav"][key] = default_dav[key] # if "caldav" value is not specified, use "webdav" value - if key not in values["caldav"]: + if key not in values["caldav"] or values["caldav"][key] is None: values["caldav"][key] = values["webdav"][key] # add default "path"s if None