fix settings

This commit is contained in:
hay-kot 2021-04-01 19:44:50 -08:00
commit 328b01e2a5

View file

@ -12,7 +12,7 @@ CWD = Path(__file__).parent
BASE_DIR = CWD.parent.parent BASE_DIR = CWD.parent.parent
ENV = BASE_DIR.joinpath(".env") 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: def determine_data_dir(production: bool) -> Path:
@ -111,7 +111,7 @@ class AppSettings(BaseSettings):
SQLITE_FILE: Optional[Union[str, Path]] SQLITE_FILE: Optional[Union[str, Path]]
@validator("SQLITE_FILE", pre=True) @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") return app_dirs.SQLITE_DIR.joinpath(f"mealie_{DB_VERSION}.sqlite")
DEFAULT_GROUP: str = "Home" DEFAULT_GROUP: str = "Home"