From 4c6d4db6349eb056959dafff7eb3df81282658b2 Mon Sep 17 00:00:00 2001 From: Mohammad Date: Tue, 7 Jan 2025 14:06:13 +0330 Subject: [PATCH] fix: json uuid encoder (#1582) --- app/utils/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/helpers.py b/app/utils/helpers.py index 19f9e4dbf..0914f5173 100644 --- a/app/utils/helpers.py +++ b/app/utils/helpers.py @@ -1,5 +1,5 @@ -from datetime import datetime as dt import json +from datetime import datetime as dt from uuid import UUID @@ -19,5 +19,5 @@ class UUIDEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, UUID): # if the obj is uuid, we simply return the value of uuid - return obj.hex - return json.JSONEncoder.default(self, obj) + return str(obj) + return super().default(self, obj)