From 2c4d5805ff66abd3c5d3e322e173f0acf8355231 Mon Sep 17 00:00:00 2001 From: jo Date: Mon, 7 Aug 2023 11:44:41 +0200 Subject: [PATCH] refactor: improve code readability --- hcloud/core/domain.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hcloud/core/domain.py b/hcloud/core/domain.py index d57d52e..1ecf948 100644 --- a/hcloud/core/domain.py +++ b/hcloud/core/domain.py @@ -25,10 +25,10 @@ def __repr__(self) -> str: def _make_serializable(value: Any) -> dict | list | str | int | float: - if isinstance(value, BoundModelBase): - value = value.data_model + if isinstance(value, (BaseDomain, BoundModelBase)): + if isinstance(value, BoundModelBase): + value = value.data_model - if isinstance(value, BaseDomain): return {key: _make_serializable(getattr(value, key)) for key in value.__slots__} if isinstance(value, dict):