model_dump() needs to use mode="json"

This commit is contained in:
Laura Klünder 2024-03-29 15:01:39 +01:00
parent 6ecfa78c5d
commit 03426c1989
4 changed files with 4 additions and 4 deletions

View file

@ -364,7 +364,7 @@ class MeshConsumer(AsyncWebsocketConsumer):
"""
async def log_received_message(self, src_node: MeshNode, msg: messages.MeshMessage):
as_json = msg.model_dump()
as_json = msg.model_dump(mode="json")
await self.channel_layer.group_send("mesh_msg_received", {
"type": "mesh.msg_received",
"timestamp": timezone.now().strftime("%d.%m.%y %H:%M:%S.%f"),