Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复mongo会话管理报错 #2079

Merged
merged 2 commits into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions common/utils/extend_json_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from uuid import UUID
from bson.objectid import ObjectId
from bson.timestamp import Timestamp
from bson.decimal128 import Decimal128
from bson.regex import Regex


@singledispatch
Expand Down Expand Up @@ -71,6 +73,16 @@ def _(o):
return str(o)


@convert.register(Decimal128)
def _(o):
return str(o)


@convert.register(Regex)
def _(o):
return str(o)


class ExtendJSONEncoder(json.JSONEncoder):
def default(self, obj):
try:
Expand Down