fix: Run after_hooks only if site is initialized
This commit is contained in:
parent
9c28368213
commit
9e87596cf1
1 changed files with 3 additions and 2 deletions
|
|
@ -77,8 +77,9 @@ def application(request: Request):
|
|||
if request.method in UNSAFE_HTTP_METHODS and frappe.db and rollback:
|
||||
frappe.db.rollback()
|
||||
|
||||
for after_request_task in frappe.get_hooks("after_request"):
|
||||
frappe.call(after_request_task, response=response, request=request)
|
||||
if getattr(frappe.local, "initialised", False):
|
||||
for after_request_task in frappe.get_hooks("after_request"):
|
||||
frappe.call(after_request_task, response=response, request=request)
|
||||
|
||||
log_request(request, response)
|
||||
process_response(response)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue