fix(Task): fix serializer to convert None to null when decoding (#63)

This commit is contained in:
Víctor Fernández Poyatos
2024-10-31 16:21:40 +01:00
committed by GitHub
parent 01045c973f
commit 43f9a5b1d0
+1 -1
View File
@@ -285,7 +285,7 @@ class TaskSerializer(RLSSerializer, TaskBase):
task_args = self.get_json_field(obj, "task_kwargs")
# Celery task_kwargs are stored as a double string JSON in the database when not empty
if isinstance(task_args, str):
task_args = json.loads(task_args.replace("'", '"'))
task_args = json.loads(task_args.replace("'", '"').replace("None", "null"))
# Remove tenant_id from task_kwargs if present
task_args.pop("tenant_id", None)