From e084a7ec9418e61d7e15f97675625a46c694746f Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 11 Mar 2023 21:27:49 +0100 Subject: switch order of env files to be parsed The priority of the value to be picked is always the last file in the `env_file` tuple We want server values to always be picked up from .env.server, and if someone wants to override them for testing, they'll go into .env But the `env.server` shouldn't be manually tampered with --- bot/constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 3aacd0a16..006d0e4ce 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -11,14 +11,13 @@ will default to the values passed to the `default` kwarg. """ import os from enum import Enum -from typing import Optional from pydantic import BaseModel, BaseSettings, root_validator class EnvConfig(BaseSettings): class Config: - env_file = ".env", ".env.server", + env_file = ".env.server", ".env", env_file_encoding = 'utf-8' env_nested_delimiter = '__' -- cgit v1.2.3