From fb8371afb9fc00b8ae04f9a7d9c11a481138f4ef Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 18 Mar 2021 13:03:34 +0100 Subject: [PATCH] [chore] Minor cleanup --- flaschengeist/models/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flaschengeist/models/__init__.py b/flaschengeist/models/__init__.py index 5f9484a..c7b94d1 100644 --- a/flaschengeist/models/__init__.py +++ b/flaschengeist/models/__init__.py @@ -15,10 +15,9 @@ class ModelSerializeMixin: import typing - if ( - typing.get_origin(self.__class__.__annotations__[param]) is typing.Union - and isinstance(typing.get_args(self.__class__.__annotations__[param])[1], type(None)) - ): + if typing.get_origin(self.__class__.__annotations__[param]) is typing.Union and typing.get_args( + self.__class__.__annotations__[param] + )[1] is type(None): return getattr(self, param) is None def serialize(self):