From e68e62364f81897ce50aae42f91d7a8697f1f8ec Mon Sep 17 00:00:00 2001 From: tazlin Date: Sat, 23 Nov 2024 13:13:37 -0500 Subject: [PATCH] fix: allow extra attribs for HordeAPIObject This makes this class consistent with `HordeAPIDataObject` and my intentions. Practically speaking, for forward compatibility and in a live situation we want to allow additional information to propagate from the API to an end user where possible. --- horde_sdk/generic_api/apimodels.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/horde_sdk/generic_api/apimodels.py b/horde_sdk/generic_api/apimodels.py index 9aea272..9884683 100644 --- a/horde_sdk/generic_api/apimodels.py +++ b/horde_sdk/generic_api/apimodels.py @@ -40,9 +40,17 @@ def get_api_model_name(cls) -> str | None: If none, there is no payload, such as for a GET request. """ - model_config = ConfigDict( - frozen=True, - use_attribute_docstrings=True, + model_config = ( + ConfigDict( + frozen=True, + use_attribute_docstrings=True, + extra="allow", + ) + if not os.getenv("TESTS_ONGOING") + else ConfigDict( + frozen=True, + use_attribute_docstrings=True, + ) )