Skip to content

Commit 1a4cc6e

Browse files
shaohuzhang1wangdan-fit2cloud
authored andcommitted
fix: Workflow execution decimal cannot be serialized (#2372)
1 parent 131b186 commit 1a4cc6e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/application/models/application.py

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@desc:
88
"""
99
import datetime
10+
import decimal
1011
import json
1112
import uuid
1213

@@ -140,6 +141,8 @@ def default(self, obj):
140141
return str(obj)
141142
if isinstance(obj, datetime.datetime):
142143
return obj.strftime("%Y-%m-%d %H:%M:%S")
144+
if isinstance(obj, decimal.Decimal):
145+
return float(obj)
143146
else:
144147
return json.JSONEncoder.default(self, obj)
145148

0 commit comments

Comments
 (0)