Feature/about api (#253)

* fix settings

* app info cleanup

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-04-02 11:02:01 -08:00
committed by GitHub
parent fd21777990
commit bc595d5cfa
7 changed files with 38 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ CWD = Path(__file__).parent
BASE_DIR = CWD.parent.parent
ENV = BASE_DIR.joinpath(".env")
PRODUCTION = os.environ.get("ENV")
PRODUCTION = os.getenv("ENV", "False").lower() in ["true", "1"]
def determine_data_dir(production: bool) -> Path:
@@ -111,7 +111,7 @@ class AppSettings(BaseSettings):
SQLITE_FILE: Optional[Union[str, Path]]
@validator("SQLITE_FILE", pre=True)
def identify_sqlite_file(_cls, v: str) -> Optional[str]:
def identify_sqlite_file(cls, v: str) -> Optional[str]:
return app_dirs.SQLITE_DIR.joinpath(f"mealie_{DB_VERSION}.sqlite")
DEFAULT_GROUP: str = "Home"
@@ -127,3 +127,5 @@ class AppSettings(BaseSettings):
settings = AppSettings()
print(settings.dict())