From ce877763f25210aeb0ff33ea1eb96f225822b2bb Mon Sep 17 00:00:00 2001 From: Jaspar Stach Date: Mon, 15 Jul 2024 15:32:03 +0200 Subject: [PATCH] Fix ruff? --- pontos/models/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pontos/models/__init__.py b/pontos/models/__init__.py index e3a839eb9..357dacc48 100644 --- a/pontos/models/__init__.py +++ b/pontos/models/__init__.py @@ -77,13 +77,13 @@ def _get_value_from_model_field_cls( value = value.replace(tzinfo=timezone.utc) elif isclass(model_field_cls) and issubclass(model_field_cls, date): value = date.fromisoformat(value) - elif get_origin(model_field_cls) == list: + elif get_origin(model_field_cls) is list: model_field_cls = get_args(model_field_cls)[0] value = _get_value_from_model_field_cls(model_field_cls, value) - elif get_origin(model_field_cls) == dict: + elif get_origin(model_field_cls) is dict: model_field_cls = dict value = _get_value_from_model_field_cls(model_field_cls, value) - elif get_origin(model_field_cls) == Union: + elif get_origin(model_field_cls) is Union: possible_types = get_args(model_field_cls) current_type = type(value) if current_type in possible_types: