Fix bug in bfxapi/notifications.py.

This commit is contained in:
Davide Casale
2023-01-10 18:19:30 +01:00
parent e215cf6a45
commit 10862aea79

View File

@@ -24,7 +24,12 @@ class _Notification(_Serializer):
if isinstance(self.serializer, _Serializer):
if self.iterate == False:
notification["NOTIFY_INFO"] = dict(self.serializer._serialize(*notification["NOTIFY_INFO"], skip=skip))
NOTIFY_INFO = notification["NOTIFY_INFO"]
if len(NOTIFY_INFO) == 1 and isinstance(NOTIFY_INFO[0], list):
NOTIFY_INFO = NOTIFY_INFO[0]
notification["NOTIFY_INFO"] = dict(self.serializer._serialize(*NOTIFY_INFO, skip=skip))
else: notification["NOTIFY_INFO"] = [ dict(self.serializer._serialize(*data, skip=skip)) for data in notification["NOTIFY_INFO"] ]
return cast(Notification, notification)