Skip to content

Commit

Permalink
refactor: improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Aug 8, 2023
1 parent c7c7fae commit 2c4d580
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hcloud/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2c4d580

Please sign in to comment.