Prevent dynaconf from merging different files. (#89)

This commit is contained in:
Giacomo Leidi 2021-10-28 21:28:12 +02:00 committed by GitHub
parent bc61ad6123
commit 84e54a503e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -61,13 +61,16 @@ def build_settings(
with importlib.resources.path(
mobilizon_reshare, "settings.toml"
) as bundled_settings_path:
SETTINGS_FILE = [
bundled_settings_path,
Path(dirs.site_config_dir, "mobilizon_reshare.toml"),
Path(dirs.user_config_dir, "mobilizon_reshare.toml"),
os.environ.get("MOBILIZION_RESHARE_SETTINGS_FILE"),
for f in [
settings_file,
]
os.environ.get("MOBILIZION_RESHARE_SETTINGS_FILE"),
Path(dirs.user_config_dir, "mobilizon_reshare.toml"),
Path(dirs.site_config_dir, "mobilizon_reshare.toml"),
bundled_settings_path,
]:
if f and Path(f).exists():
SETTINGS_FILE = f
break
ENVVAR_PREFIX = "MOBILIZON_RESHARE"
return Dynaconf(