[chore] Minor cleanup
This commit is contained in:
parent
85f83f46d5
commit
fb8371afb9
|
@ -15,10 +15,9 @@ class ModelSerializeMixin:
|
||||||
|
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
if (
|
if typing.get_origin(self.__class__.__annotations__[param]) is typing.Union and typing.get_args(
|
||||||
typing.get_origin(self.__class__.__annotations__[param]) is typing.Union
|
self.__class__.__annotations__[param]
|
||||||
and isinstance(typing.get_args(self.__class__.__annotations__[param])[1], type(None))
|
)[1] is type(None):
|
||||||
):
|
|
||||||
return getattr(self, param) is None
|
return getattr(self, param) is None
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
|
|
Loading…
Reference in New Issue