Skip to content

Commit

Permalink
Added explicit extra="ignore" to BaseDBConfig.
Browse files Browse the repository at this point in the history
Despite Pydantic static that is the default value, without this the demo django app will not start with error linking to https://errors.pydantic.dev/2.5/v/extra_forbidden
  • Loading branch information
Andrey Lepekhin committed Nov 28, 2023
1 parent c9fe6e6 commit 3de8fc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pydjantic/pydjantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import dj_database_url
from pydantic import SecretBytes, SecretStr, ValidationInfo, field_validator
from pydantic_core import MultiHostUrl
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict


class BaseDBConfig(BaseSettings):
model_config = SettingsConfigDict(extra="ignore")

@field_validator("*")
def format_config_from_dsn(cls, value: Any, info: ValidationInfo):
if value is None:
Expand Down

0 comments on commit 3de8fc6

Please sign in to comment.