[chore] Minor cleanup
This commit is contained in:
parent
85f83f46d5
commit
fb8371afb9
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue