浏览代码

Check meta data format in json map (#4461)

### What problem does this PR solve?

#3690

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
tags/v0.16.0
Kevin Hu 9 个月前
父节点
当前提交
c08382099a
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      api/apps/document_app.py

+ 4
- 0
api/apps/document_app.py 查看文件

except Exception as e: except Exception as e:
return get_json_result( return get_json_result(
data=False, message=f'Json syntax error: {e}', code=settings.RetCode.ARGUMENT_ERROR) data=False, message=f'Json syntax error: {e}', code=settings.RetCode.ARGUMENT_ERROR)
if not isinstance(meta, dict):
return get_json_result(
data=False, message='Meta data should be in Json map format, like {"key": "value"}', code=settings.RetCode.ARGUMENT_ERROR)

try: try:
e, doc = DocumentService.get_by_id(req["doc_id"]) e, doc = DocumentService.get_by_id(req["doc_id"])
if not e: if not e:

正在加载...
取消
保存