浏览代码

fix: respect Accept headers during maintenance mode #18057 (#18063)

(cherry picked from commit 022df94711)

Co-authored-by: Ankush Menat <ankush@frappe.io>
version-14
mergify[bot] 2 年前
committed by GitHub
父节点
当前提交
f6661cbfa0
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      frappe/app.py

+ 3
- 3
frappe/app.py 查看文件

@@ -83,9 +83,6 @@ def application(request: Request):
except HTTPException as e: except HTTPException as e:
return e return e


except frappe.SessionStopped as e:
response = frappe.utils.response.handle_session_stopped()

except Exception as e: except Exception as e:
response = handle_exception(e) response = handle_exception(e)


@@ -228,6 +225,9 @@ def handle_exception(e):
# if the request is ajax, send back the trace or error message # if the request is ajax, send back the trace or error message
response = frappe.utils.response.report_error(http_status_code) response = frappe.utils.response.report_error(http_status_code)


elif isinstance(e, frappe.SessionStopped):
response = frappe.utils.response.handle_session_stopped()

elif ( elif (
http_status_code == 500 http_status_code == 500
and (frappe.db and isinstance(e, frappe.db.InternalError)) and (frappe.db and isinstance(e, frappe.db.InternalError))


正在加载...
取消
保存