fix: allow extra environment variables in pydantic-settings
Add extra='ignore' to Settings Config to prevent ValidationError when .env files contain deprecated variables (e.g., PADDLEOCR_MODEL_DIR). This ensures backwards compatibility with Docker deployments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -416,6 +416,9 @@ class Settings(BaseSettings):
|
|||||||
)
|
)
|
||||||
env_file_encoding = "utf-8"
|
env_file_encoding = "utf-8"
|
||||||
case_sensitive = False
|
case_sensitive = False
|
||||||
|
# Ignore extra environment variables not defined in Settings
|
||||||
|
# This allows backwards compatibility with old .env files (e.g., Docker)
|
||||||
|
extra = "ignore"
|
||||||
|
|
||||||
def _resolve_path(self, path_value: str) -> Path:
|
def _resolve_path(self, path_value: str) -> Path:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user