From e8edb34b9b4a160a09b1628fb0a8e0b4dbd5ae20 Mon Sep 17 00:00:00 2001 From: MauricioGarciaS <47052044+MauricioGarciaS@users.noreply.github.com> Date: Fri, 25 Nov 2022 12:53:36 +0100 Subject: [PATCH] Fix insert for json format --- ee/api/chalicelib/utils/events_queue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/api/chalicelib/utils/events_queue.py b/ee/api/chalicelib/utils/events_queue.py index 1cf344061..8c44a1690 100644 --- a/ee/api/chalicelib/utils/events_queue.py +++ b/ee/api/chalicelib/utils/events_queue.py @@ -1,3 +1,4 @@ +import json import queue import logging @@ -17,7 +18,7 @@ class EventQueue(): while not self.events.empty(): project_id, user_id, element = self.events.get() events.append("({project_id}, '{user_id}', {timestamp}, '{action}', '{source}', '{category}', '{data}')".format( - project_id=project_id, user_id=user_id, timestamp=element.timestamp, action=element.action, source=element.source, category=element.category, data=element.data)) + project_id=project_id, user_id=user_id, timestamp=element.timestamp, action=element.action, source=element.source, category=element.category, data=json.dumps(element.data))) if len(events)==0: return 0 if self.test: