Skip to content

Commit 867087c

Browse files
committed
Update the default datetime conversion
1 parent b9d506f commit 867087c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backend/common/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from pydantic import BaseModel, ConfigDict, EmailStr, Field, validate_email
77

8-
from backend.core.conf import settings
98
from backend.utils.timezone import timezone
109

1110
# 自定义验证错误信息,参考:
@@ -128,6 +127,6 @@ class SchemaBase(BaseModel):
128127
json_encoders={
129128
datetime: lambda x: timezone.to_str(timezone.from_datetime(x))
130129
if x.tzinfo is not None
131-
else x.strftime(settings.DATETIME_FORMAT)
130+
else timezone.to_str(x)
132131
},
133132
)

0 commit comments

Comments
 (0)