Skip to content

Commit 7ef52e8

Browse files
committed
Use extended_json_encoder when dumping message contents everywhere
1 parent 16064a4 commit 7ef52e8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/aleph/sdk/client/authenticated_http.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ async def _broadcast_deprecated(self, message_dict: Mapping[str, Any]) -> None:
215215

216216
async with self.http_session.post(
217217
url,
218-
json={"topic": "ALEPH-TEST", "data": json.dumps(message_dict)},
218+
json={
219+
"topic": "ALEPH-TEST",
220+
"data": json.dumps(message_dict, default=extended_json_encoder),
221+
},
219222
) as response:
220223
await self._handle_broadcast_deprecated_response(response)
221224

@@ -678,7 +681,9 @@ async def _storage_push_file_with_message(
678681
"sync": sync,
679682
}
680683
data.add_field(
681-
"metadata", json.dumps(metadata), content_type="application/json"
684+
"metadata",
685+
json.dumps(metadata, default=extended_json_encoder),
686+
content_type="application/json",
682687
)
683688
# Add the file
684689
data.add_field("file", file_content)

0 commit comments

Comments
 (0)