fix: Replace render() with get_response
This commit is contained in:
parent
34592aa069
commit
e18a43e11d
2 changed files with 5 additions and 5 deletions
|
|
@ -20,6 +20,7 @@ import frappe.api
|
|||
import frappe.utils.response
|
||||
from frappe.utils import get_site_name, sanitize_html
|
||||
from frappe.middlewares import StaticDataMiddleware
|
||||
from frappe.website.serve import get_response
|
||||
from frappe.utils.error import make_error_snapshot
|
||||
from frappe.core.doctype.comment.comment import update_comments_in_parent_after_request
|
||||
from frappe import _
|
||||
|
|
@ -73,7 +74,7 @@ def application(request):
|
|||
response = frappe.utils.response.download_private_file(request.path)
|
||||
|
||||
elif request.method in ('GET', 'HEAD', 'POST'):
|
||||
response = frappe.website.render.render()
|
||||
response = get_response()
|
||||
|
||||
else:
|
||||
raise NotFound
|
||||
|
|
@ -255,8 +256,7 @@ def handle_exception(e):
|
|||
make_error_snapshot(e)
|
||||
|
||||
if return_as_message:
|
||||
response = frappe.website.render.render("message",
|
||||
http_status_code=http_status_code)
|
||||
response = get_response("message", http_status_code=http_status_code)
|
||||
|
||||
return response
|
||||
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@ def json_handler(obj):
|
|||
|
||||
def as_page():
|
||||
"""print web page"""
|
||||
from frappe.website.render import render
|
||||
return render(frappe.response['route'], http_status_code=frappe.response.get("http_status_code"))
|
||||
from frappe.website.serve import get_response
|
||||
return get_response(frappe.response['route'], http_status_code=frappe.response.get("http_status_code"))
|
||||
|
||||
def redirect():
|
||||
return werkzeug.utils.redirect(frappe.response.location)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue