Skip to content

Commit

Permalink
不抛错给用户, 改为输出日志
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Nov 1, 2023
1 parent 5bf7bde commit 591f5fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sql/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def archive_apply(request):
try:
audit_handler.create_audit()
except AuditException as e:
return JsonResponse({"status": 1, "msg": f"新建审批流失败: {str(e)}", "data": {}})
logger.error(f"新建审批流失败: {str(e)}")
return JsonResponse({"status": 1, "msg": "新建审批流失败, 请联系管理员", "data": {}})
async_task(
notify_for_audit,
workflow_audit=audit_handler.audit,
Expand Down
2 changes: 1 addition & 1 deletion sql/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ def test_archive_apply_not_exist_review(self):
r = self.client.post(path="/archive/apply/", data=data)
self.assertDictEqual(
json.loads(r.content),
{"data": {}, "msg": "新建审批流失败: 审批类型 数据归档申请 未配置审流", "status": 1},
{"data": {}, "msg": "新建审批流失败, 请联系管理员", "status": 1},
)

@patch("sql.archiver.async_task")
Expand Down

0 comments on commit 591f5fe

Please sign in to comment.