Skip to content

Commit

Permalink
fix: serialize tracking log data and context dates as logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 13, 2024
1 parent 5436bec commit 61e16bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eventtracking/backends/event_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from openedx_events.analytics.signals import TRACKING_EVENT_EMITTED
from openedx_events.event_bus import get_producer

from eventtracking.backends.logger import DateTimeJSONEncoder
from eventtracking.backends.routing import RoutingBackend
from eventtracking.config import SEND_TRACKING_EVENT_EMITTED_SIGNAL

Expand All @@ -33,8 +34,8 @@ def send(self, event):
if name not in getattr(settings, "EVENT_BUS_TRACKING_LOGS", []):
return

data = json.dumps(event.get("data"))
context = json.dumps(event.get("context"))
data = json.dumps(event.get("data"), cls=DateTimeJSONEncoder)
context = json.dumps(event.get("context"), cls=DateTimeJSONEncoder)

timestamp = event.get("timestamp")

Expand Down

0 comments on commit 61e16bf

Please sign in to comment.