From 10862aea79a0b38a3da834d5b3c04c4c8cd88fdd Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Tue, 10 Jan 2023 18:19:30 +0100 Subject: [PATCH] Fix bug in bfxapi/notifications.py. --- bfxapi/notification.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bfxapi/notification.py b/bfxapi/notification.py index 5bb4cab..90d2f12 100644 --- a/bfxapi/notification.py +++ b/bfxapi/notification.py @@ -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) \ No newline at end of file