Refactor global datetime to timezone datetime (#152)

This commit is contained in:
Wu Clan
2023-06-20 16:50:42 +08:00
committed by GitHub
parent da6f6b8c24
commit 3d0d0ccde3
62 changed files with 359 additions and 475 deletions

View File

@ -86,9 +86,7 @@ def register_exception(app: FastAPI):
for error in raw_exc.errors()[:1]:
field = str(error.get('loc')[-1])
msg = error.get('msg')
message += (
f'{data.get(field, field) if field != "__root__" else ""} {msg}' + '.'
)
message += f'{data.get(field, field) if field != "__root__" else ""} {msg}' + '.'
elif isinstance(raw_error.exc, json.JSONDecodeError):
message += 'json解析失败'
content = {