From fd059693977288c1fc711425dd5f40290e046a9e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 15 Sep 2024 10:55:59 +0200 Subject: [PATCH] Fix change_config() and support 'allow' as well. --- src/antsibull_core/pydantic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/antsibull_core/pydantic.py b/src/antsibull_core/pydantic.py index 7e883f2..c46cf92 100644 --- a/src/antsibull_core/pydantic.py +++ b/src/antsibull_core/pydantic.py @@ -59,10 +59,10 @@ def _modify_config( def set_extras( models: type[p.BaseModel] | Collection[type[p.BaseModel]], - value: t.Literal["forbid", "ignore"], + value: t.Literal["allow", "ignore", "forbid"], ) -> None: def change_config(model_config: p.ConfigDict) -> bool: - if model_config.get("extra") != value: + if model_config.get("extra") == value: return False model_config["extra"] = value return True